0

I'm experiencing something 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?

4

1 に答える 1

4

ヒープがいっぱいであると思われます。古いスペース + eden スペースの合計が最大ヒープ スペースになる場合、サバイバー スペース用のスペースがなく、世代別コレクターを実行できません。

最大ヒープ領域を増やしてみてください。


ポイントは、eden スペースのコレクションを生き残るすべてのオブジェクトを保持するために、生存スペースに十分な空きスペースが必要であるということです。空き領域が利用できない場合、コピー コレクターは機能せず、JVM はマーク アンド スイープにフォールバックする必要があります。

これは、世代/コピー コレクターがどのように機能するかの基本です。

私が言ったように、ヒープスペースを増やしてみてください。

于 2011-07-09T05:22:53.543 に答える