I want my Memory back ;-)

Leandro Lucarella luca at llucax.com.ar
Mon Jul 12 17:31:33 PDT 2010

ABothe, el 12 de julio a las 23:44 me escribiste:
> Hi everyone,
> I don't know if it's a bug or not .. but D or at least its GC doesn't want to
> free my allocated stuff! Also when I 'disable' the GC via GC.disable(); it
> won't free it :-/

Disable that exactly that, force the GC *not* to run a collection.

> byte[] asdf=new byte[50_000_000]; // OK a bit much---but it's an example value

This is a clasical problem of the conservative GC. The problem is, false
pointers would keep your large chunks of memory alive (the bigger the
chunk, the higher the probability of a random word being confused as
a pointer into it).

There were some solutions proposed, but none accepted yet:

> GC.free(&asdf); // It doesn't work!!
> delete asdf; // Also, without GC.free, doesn't work!!!

Those 2 *must* work. What are you doing to check if they work?

Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
There is no pain you are receding
A distant ship, smoke on the horizon.
You are only coming through in waves.
Your lips move but I can't hear what you're saying.

More information about the Digitalmars-d mailing list