Understanding GC policy information displayed by GCMonitor Java Agent extension

Document ID : KB000020301
Last Modified Date : 16/05/2018
Show Technical Document Details
Question:

WebSphere Admin is starting up JVM with -Xgcpolicy:gencon, but in Introscope it looks like it is going with the default non-generational GC. According to Introscope GCMonitor metrics the GC Policy is 'Copy:MarkSweepCompact' and there is only one pool for the heap, not multiple as expected as described in the IBM documentation regarding gencon GC.

Answer:

GCMonitor extension displays information by polling PlatformMXBeans exposed by a particular vendor's JVM implementation.

http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/management/package-summary.html

You can use JConsole utility which ships with IBM JDK to view this information outside Workstation Investigator.

Two particular PlatformMXBeans which we monitor are,GarbageCollectorMXBean(provides information on GC Collector used by JVM)
and MemoryPoolMXBean(provides info on Memory Pools used by the JVM) , which drives majority of information displayed by GCMonitor extension.

For IBM JVM's only MemoryPoolMXBean monitored by us is of type "Heap" and called "Java Heap" which is why you only see one node in Investigator.
For Sun JVM's it's same except that we also monitor PermGen which is of type "Non-Heap".

Specifying a GC Policy for IBM JVM's only controls the behavior of the application and how Garbage Collection will be performed but actual GarbageCollector or algorithm used is different for each policy.

For the gencon GC policy, two MBeans are available:

- Copy, which is for the nursery.
- MarkSweepCompact, which is for tenured memory.

For all other GC policies, only the MarkSweepCompact MBean is available. For details see

http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=%2Fcom.ibm.java.doc.diagnostics.60%2Fdiag%2Ftools%2Fmxbeans.html

"GC Policy" metric that you see in Investigator is not directly based off the value of -Xgcpolicy argument but instead based on the name of GarbageCollector used by the JVM which in case of gencon is Copy and MarkSweepCompact hence shown as Copy:MarkSweepCompact.