AA Troubles

Jonathan Crapuchettes jcrapuchettes at gmail.com
Wed May 11 08:36:18 PDT 2011


1. I will give you implementation a try.
2. I have been compiling with 64-bit as I expect most of the programs I write 
require more than 4GB of memory.

Thanks!

dsimcha wrote:
> On 5/10/2011 9:54 PM, Jonathan Crapuchettes wrote:
>> Hey all,
>>
>> I have been working with a lot of associative arrays of late and been
>> running into some problems with the built-in implementation. It appears
>> that very heavy use in an application can cause the garbage collector to
>> have issues. Most of the time I have found ways around the problems, but
>> the one that I ran into today has made me wonder if there is a less
>> error prone/slower implementation of AAs out there for D that doesn't
>> pound the GC as hard. I have looked at the aa project at dsource and
>> noticed some discussion on the forums from a little while ago, but I
>> wasn't sure how up-to-date everything was.
>>
>> The problem that I ran into appears, according to gdb, to be in
>> gc.gcx.Gcx.findPool(). During the execution of my program, the code
>> halts at one point with 1 core maxed (i.e. infinite loop) about 6
>> minutes into the execution with about 2.1GB of memory allocated. When I
>> said that I used the AAs a lot, I mean that most of the memory is
>> allocated to classes that are only accessible through the AAs. I wish
>> that I could give you an example, but at the point of the halt, the
>> program had pulled data from a 60M row database table and run through
>> about 500 lines of code.
>>
>> I know that I usually don't comment in this forum unless I have a
>> problem, and I appreciate that I still get replies. Just know that I am
>> a great proponent of D and make very heavy use of it in a corporate
>> environment doing a lot of cutting-edge economic calculations. Thank you
>> to all who have contributed to D!
>>
>> Thank you,
>>
>> Jonathan
>
> Two things:
>
> 1. This is one of the main problems my RandAA associative array implementation
> was meant to solve. It's usable but not completely polished yet.
>
> Code:
>
> http://dsource.org/projects/aa/browser/trunk/randAA/randaasealed.d
>
> Docs:
>
> http://cis.jhu.edu/~dsimcha/randaasealed.html
>
> 2. If you're using Linux, try compiling a 64-bit binary. Since pointers now have
> twice as many bits, false pointers are orders of magnitude less probable.


More information about the Digitalmars-d mailing list