[Issue 11021] Huge GC leak leads to crash; GC uses 7x more memory

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 13 10:38:14 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=11021



--- Comment #7 from monarchdodra at gmail.com 2013-09-13 10:38:13 PDT ---
(In reply to comment #4)
> I would actually expect it to use 90mb, your allocating a 40mb array inside a
> loop, the previous 40mb array will still be referenced when you go to allocate
> the new 40mb array, meaning that it can't be collected if the second allocation
> triggers a GC.

(In reply to comment #6)
> You should really be clearing the existing array rather than allocating a new
> one, but that's beside the point. When you call the GC manually, the array is
> still referenced in local variable, if you were to reset that local variable
> before calling the GC, then it should collect it correctly.

He keeps no references to the array, so it should be collected immediatly on
each call to GC.collect(). OR at least, there is no reason for it not to be
collected.

That said, I'm unsure "GC.collect()" promises it'll acutally *do* anything,
it's more of a hint "now would be a good time to run a collection" (AFAIK).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list