简体   繁体   English

空堆的频繁完整GC

[英]Frequent full GC with empty heap

I've got a GC log file that shows frequent full GC when the heap is empty (every 30 mins initially, then 20, 10, 5 up to few events a minute. At some point, though, I can see a sudden increase in the heap usage (I'd imagine at the moment when users start connecting to my application) and full GC events start to take place less freqently. I can't think of a reason why this may happen. 我有一个GC日志文件,当堆为空时显示频繁的完整GC(最初每30分钟,然后每分钟20、10、5,最多每分钟有几个事件。但是,在某个时刻,我可以看到堆使用情况(我想像在用户开始连接到我的应用程序的那一刻)和完整的GC事件开始发生的频率降低了,我想不出发生这种情况的原因。

I'm using Oracle Vm 1.6, and my startup script is: 我正在使用Oracle Vm 1.6,我的启动脚本是:

java -XX:+HeapDumpOnOutOfMemoryError \
     -Xmx7500m \
     -XX:HeapDumpPath=../logs \
     -verbose:gc \
     -XX:+PrintGCDetails \
     -XX:+PrintGCTimeStamps \
     -Xloggc:/app/diffusion/Logs/gc.log \
     -Dcom.sun.management.jmxremote \
     -Dcom.sun.management.jmxremote.ssl=false \
     -Dcom.sun.management.jmxremote.authenticate=false \
     -Dcom.sun.management.jmxremote.port=2000 \
     -cp ../lib/diffusion.jar:../etc:../data com.pushtechnology.diffusion.Diffusion $1

Try disabling explicit GC, see if it helps : -XX:+DisableExplicitGC . 尝试禁用显式GC,看看是否有帮助: -XX:+DisableExplicitGC

Then, you could collect a few thread dumps to confirm that there is nothing really running in the app when the heap is empty. 然后,您可以收集一些线程转储,以确认堆为空时应用程序中没有真正运行的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM