频繁满GC,空堆 [英] Frequent full GC with empty heap
问题描述
我有一个GC日志文件,当堆空时(每30分钟一次,然后是20,10,5每分钟几次事件)显示频繁的完整GC。不过,在某些时候,我可以看到堆使用的突然增加(我想象在用户开始连接到我的应用程序的那一刻),并且完整的GC事件开始发生得不那么频繁。
我想不出为什么会发生这种情况。
我使用的是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
尝试禁用显式GC,看看它是否有帮助: -XX:+ DisableExplicitGC
。 然后,您可以收集几个线程转储,以确认应用程序中没有真正运行的应用程序堆是空的。
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
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.
这篇关于频繁满GC,空堆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!