Reputation: 319
We have an an enterprise application deployed in wildfly 8.2 with min & max heap set to 1.5 GB. One of the actions is causing too much objects to be loaded into the heap. Although the object is dereferenced after the action, the jvm heap usage is not coming down.
But, if I manually trigger GC externally(using jcmd), I am seeing a huge dip in the heap usage. Why is normal GC not reducing the memory as much as GC.run?
JVM settings
-Xms1536m -Xmx1536m -XX:MaxMetaspaceSize=512m -XX:ReservedCodeCacheSize=128M -server -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Djsse.enableSNIExtension=false -Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000
Upvotes: 0
Views: 787
Reputation: 200148
What you trigger from the outside is Major/Full GC, which is not triggered automatically unless absolutely necessary. The JVM tries to make a living with garbage in the Old Generation for as long as it can, in order to avoid the infamous GC pause.
Upvotes: 2