Summary: GC -- 99% CPU in g...@gcx@g...@mark()
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime

--- Comment #0 from 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:
------- You are receiving this mail because: -------

Reply via email to