简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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