4 ms·
Are you interpreting "GC every heap allocation" as "each heap allocation causes an entire cycle of GC"? That's...not what that phrase means.
by scottlamb 3y ago
Are you interpreting "GC every heap allocation" as "each heap allocation causes an entire cycle of GC"? That's...not what that phrase means.
- charcircuit 3y agoYes I am. Java's GC can stop the world at any safepoint. It isn't limited to when objects are allocated and it doesn't do it every time.
- scottlamb 3y agoI'm aware. A cycle per allocation would be absurdly expensive. "GC every heap allocation" actually means that every heap allocation is subject to garbage collection and has to be traversed on every cycle in which it's reachable. If the GC algorithm uses compaction and/or generations, it gets moved around too. That all has a cost.