Is Phobos's Garbage Collector utterly broken? (Phobos vs Tango)
Jascha Wetzel
"[firstname]" at mainia.de
Mon Aug 6 04:52:34 PDT 2007
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.
More information about the Digitalmars-d
mailing list