JDK-6580448 : CMS: Full GC collection count mismatch between GarbageCollectorMXBean and jvmstat (VisualGC)
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-07-13
  • Updated: 2011-07-20
  • Resolved: 2010-06-16
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
GarbageCollectorMXBean.getCollectionCount for the ConcurrentMarkSweep
garbage collector doesn't return the same value as VisualGC and the
sun.gc.collector.1.invocations jvmstat performance counter.

The collection count for the minor GC collections is correct.

The problem showed on Windows XP with JDK 6 b105. However, I couldn't
reproduce it on Solaris/SPARC.

Steps to reproduce this problem on Windows XP:

1/ Start NetBeans 6
2/ Install the VisualGC plugin
3/ Connect VisualGC to the NetBeans target VM
4/ Check the number of Old Gen collections
5/ Start JConsole and connect it to the NetBeans target VM
6/ Go to the Memory tab
7/ Check the number of ConcurrentMarkSweep collections

There should be a mismatch between 4/ and 7/.

Explicitly calling System.gc (use the PerformGC button in Memory tab
in JConsole) increments the number of ConcurrentMarkSweep collections
by one but it doesn't compute the real value for total collections.

Comments
EVALUATION GarbageCollectorMXBean information is not updated by a CMS collection. The fix I'd proposed for 6581734 fixes this bug also. Closing as dup of 6581734 and will try and get 6581734 integrated.
16-06-2010