Following are the snapshots I took after executing perform GC from jvisualvm. and
First image is Heap stats and 2nd one is perm gen stats. I am not able to understand when I did GC utilized heap size decreased(as expected) but the allocated size of permanent generation increased (though the utilized permgen size remained the same).What could be the possible explanation of such behavior?
JVM arguments used
-Xbootclasspath/p:../xyz.jar
-Xbootclasspath/a:../abc.jar
-Djava.endorsed.dirs=../resolver
-Djava.library.path=../framework
-Djavax.management.builder.initial=JBeanServerBuilder
-Djavax.net.ssl.trustStore=../certs
-Dorg.mortbay.log.class=JettyLogger
-Xms128m
-Xmx256m
-Xdebug
-Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=2000
Note : I have changed the name(ex xyz.jar) for propriety reasons.
JVm Info:
JVM: Java HotSpot(TM) 64-Bit Server VM (23.6-b04, mixed mode)
Java: version 1.7.0_11, vendor Oracle Corporation
Java Home: /home/aniket/jdk1.7.0_11/jre
JVM Flags: <none>
You can improve performance by increasing your heap size or using a different garbage collector. In general, for long-running server applications, use the J2SE throughput collector on machines with multiple processors (-XX:+AggressiveHeap) and as large a heap as you can fit in the free memory of your machine.
The permanent generation is still part of the heap.
When objects are garbage collected from the Old Generation, it is a major garbage collection event. Permanent Generation: Metadata such as classes and methods are stored in the Permanent Generation. Classes that are no longer in use may be garbage collected from the Permanent Generation.
Permanent Generation or “Perm Gen” contains the application metadata required by the JVM to describe the classes and methods used in the application. Note that Perm Gen is not part of Java Heap memory. Perm Gen is populated by JVM at runtime based on the classes used by the application.
Below link will be really useful:
http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html
since nobody offers an answer, I make my comment an answer, although it is a little vague:
I'd guess that the GC reevaluates the various sizes it has to control as part of the collection run. So it might decide that it is a little tight on the perm gen side of things an increase it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With