Apparent problem with GC not collecting on Windows
Michael
pr at m1xa.com
Thu Nov 29 12:06:49 PST 2012
> Because you used uint instead of ubyte, array is bigger, memory
> exhausts faster.
Oh, I see.
>> 3. Why it helps?
>> GC.free(data.ptr);
>
> Initial leak happened because for some reason array allocated
> in previous iteration was not collected by GC when allocating
> new one, so the new one was allocated in another space growing
> the heap. If you place GC.free the array gets removed from heap
> on each iteration and each new allocation reuses the same
> memory, heap doesn't grow.
If we do this manually it's works, but automatically is broken?
More information about the Digitalmars-d-learn
mailing list