JMX を介して監視されているサービスがあります。JVM ヒープの使用量が増えており、主要なコレクションでさえガベージを削除できません。ヒープを調べると、RMI 関連の参照 (すべてではないにしても、ほとんどの場合、関連するクラス ローダー) で構成されるガベージが表示されます。この問題を軽減する唯一の方法は、JMX を介して明示的な gc 呼び出しを発行することです (これにより、蓄積されたゴミがすべて削除されます)。GC 関連のオプションは次のとおりです。
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:SurvivorRatio=8
-XX:MaxTenuringThreshold=1
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
DisableExplicitGC または sun.rmi.dgc.server.gcInterval のいずれにも触れていません。
この問題は、sun.misc.GC.Daemon のコードによって対処されるはずだと思います。
public void run() {
for (;;) {
long l;
synchronized (lock) {
l = latencyTarget;
if (l == NO_TARGET) {
/* No latency target, so exit */
GC.daemon = null;
return;
}
long d = maxObjectInspectionAge();
if (d >= l) {
/* Do a full collection. There is a remote possibility
* that a full collection will occurr between the time
* we sample the inspection age and the time the GC
* actually starts, but this is sufficiently unlikely
* that it doesn't seem worth the more expensive JVM
* interface that would be required.
*/
System.gc();
d = 0;
}
/* Wait for the latency period to expire,
* or for notification that the period has changed
*/
try {
lock.wait(l - d);
} catch (InterruptedException x) {
continue;
}
}
}
}
何らかの理由で、上記の System.gc が呼び出されていません (これは gc ログを見て確認されています)。問題に対処する方法について誰か提案がありますか?