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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 5 15:57:24 PST 2010


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

           Summary: GC -- 99% CPU in gc at gcx@Gcx at mark()
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: sean at invisibleduck.org
        ReportedBy: wfunction at hotmail.com


--- Comment #0 from wfunction at hotmail.com 2010-12-05 15:55:48 PST ---
I was running a piece of code that allocated a huge block of memory at once,
then allocated small chunks after that inside a block, deleting them at the end
of the scope. I managed to get the code down to this:

auto temp = new void[0x8080 * 4096];
for (int i = 0; i < 0x8080 * 4; i++)
{ scope auto temp2 = new void[0x10100]; }

What happens is, after the first few ten thousands of collections (for me, it
was around after 62,000 collections), the time spent in the mark() method
shoots up to around 99% of the application's time, and the program effectively
hangs at the allocation.

The numbers above were specific to my system; they're rather arbitrary. All you
need to do is:
(1) Run the code, and break into the process before around 1 second. Notice
that, when you do this, it's often inside memset() or some other function, and
not the GC.
(2) Run the code, and break into the process after several seconds have passed.
At this time, it's practically guaranteed that you're in the mark() method --
and in fact, for me, it froze my application.

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