Is Phobos's Garbage Collector utterly broken? (Phobos vs Tango)

Sean Kelly sean at f4.ca
Mon Aug 6 08:31:34 PDT 2007


Jascha Wetzel wrote:
> Vladimir Panteleev wrote:
>> On Wed, 01 Aug 2007 09:08:16 +0300, Vladimir Panteleev 
>> <thecybershadow at gmail.com> wrote:
>>
>>> I initially wrote it to try to find a memory leak in Tango's GC 
>>> (which was actually fixed at some point).
>>
>> Turns out it's still there, and it's the old "binary data" issue with 
>> pointer-searching GCs, which was fixed in D/Phobos 1.001 by making the 
>> GC type-aware. Check out the attached sample programs for a simple 
>> example - the Tango version can't know there are no pointers in its 
>> GrowBuffer's data, and thus leaks like crazy, while the Phobos version 
>> stays at 13MB.
> 
> i ran into another issue with the phobos gc. i have constant array 
> literals that are used in a constructor to initialize a member. the data 
> isn't always used. each instance uses it at most once. the second time 
> an instance uses that data, it has been overwritten. the problem 
> disappears if i disable the gc.
> it looks like the gc frees the memory that holds the constant 
> initializer. unfortunately it's really hard to reproduce this problem in 
> a small program.

Have you tested this with Tango?  I would expect the same broken 
behavior but you never know, and any differences may help track down the 
issue.


Sean



More information about the Digitalmars-d mailing list