Any advice for GC/memory debugging
Alan Knowles
alan at akbkhome.com
Tue Sep 2 00:42:05 PDT 2008
Unfortunatly Tango doesnt seem to install on freeBSD -
I just get:
make: don't know how to make aaA.o. Stop
I'm having a go adding the minimize code from tango to phobos - any
thoughts on if it should work? - it takes forever to build on this
freebsd box...
Regards
Alan
Sean Kelly wrote:
> Alan Knowles wrote:
>> Having fleshed out an SMTP server, I've now started testing it against
>> a good load level.
>>
>> Apart from the various thread issues in phobos (getHostbyName is not
>> thread safe etc./ using udns solved alot of this...) - my bigger worry
>> is memory management.
>>
>> With GC enabled/or even disabled, the memory pool will rise to ~ 200Mb
>> from the baseline of ~20K and run out of memory on the box it's
>> running on. The test box we have peaks at about 30 concurrent
>> connections/threads. - compiled using GDC (as it's FreeBSD)
>>
>> From what i've seen, there is no real way to disable the Garbage
>> collection, in terms of stopping it from managing the
>> allocation/deallocation of memory? as it is too intertwined in the
>> management of things like char[] etc..
>>
>> Has anyone found good ways to analyze where the application may be
>> leaking memory/allocating to much memory - hooks in the in/out
>> properties of methods ?
>
> With Tango you can attach a cleanupHandler and use it to dump info on
> objects being collected. I'm planning to add more debugging features as
> well, but they aren't in yet. However, on Tango I'd add some logging to
> lib/gc/basic/gc.d and on Phobos I'd add it to internal/gc/gc.d.
>
>> Is there any way to compact the memory, as the pool appears to jump
>> quite dramatically from ~ 64k->100Mb->250Mb, even though it looks like
>> the used pool is significantly smaller..
>
> Tango offers a GC.minimize() routine that may help. I believe the same
> routine is in Phobos as well but it's not actually implemented.
>
>
> Sean
More information about the Digitalmars-d-learn
mailing list