Frequent full GC with empty heap

前提是你 提交于 2019-12-23 03:46:10

问题


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.

I'm using Oracle Vm 1.6, and my startup script is:

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

回答1:


Try disabling explicit GC, see if it helps : -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.



来源:https://stackoverflow.com/questions/15422352/frequent-full-gc-with-empty-heap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!