开发者

Hotspot's scavenge GC stops running, leaving only the mark-sweep GC

I'm experiencing somethin开发者_JS百科g weird with Hotspot's GC in a certain program. Sometimes, it seems almost as if the scavenge GC just dies, leaving only the mark-sweep GC running instead every time the Eden space fills up. Needless to say, this is horrible for performance. I haven't managed to figure out the conditions for this issue to occur.

Looking at a JVM with this behavior right now, the old-gen is 170 MB (used and max) and never grows or shrinks over a collection, the Eden gen is 85 MB, the Survivor spaces are never used whatsoever (which I guess is consistent with the scavenge GC not running), and the total allocated heap size is 256 MB (matching, obviously, Old+Eden).

Any clues as to what might cause this?


I suspect that the heap is too full. If the old space + eden space add up to the max heap space, then there is no room for a survivor space and a generational collector can't be run.

Try increasing the maximum heap space.


The point is that there has to be enough free space in the survivor space(s) to hold all objects that survive the collection of the eden space. If the free space isn't available, then a copying collector cannot work and the JVM has to fall back to mark and sweep.

This is fundamental to how generational / copying collectors work.

Like I said, try increasing the heap space.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜