[Issue 5326] GC -- 99% CPU in gc at gcx@Gcx at mark()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 6 02:08:00 PST 2010


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


nfxjfg at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nfxjfg at gmail.com


--- Comment #1 from nfxjfg at gmail.com 2010-12-06 02:05:55 PST ---
That's somewhat excpected. The mark() function is the core of the garbage
collector, where it basically follows all references in the program's heap.

void[] arrays can potentially contain references, so the GC has to mark() these
as well. (Why are you using void[]? 10 dollars on you have no real reason.)
What makes things worse: each time there's a pointer into a large memory block,
the GC has to do a linear scan to find the beginning of the memory block. And
you are alocating LARGE blocks (32k pages!), so that might become significant.

I think what's happening is that your heap is exploding due to false pointers.
The memory allocations are so large that there's always something that looks
like a pointer pointing into it, so it never gets free'd. A larger heap means
higher collection times.

So, this is probably not a bug.

-- 
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