JMX old gen GC count is incremented by 2 at a System.gc() in CMS in JDK6u23-6u26, while it incremented by 1 in 6u22 and earlier. (original) (raw)

D:\sdk\groovy-1.7.6\bin>set JAVA_OPTS=-XX:+UseConcMarkSweepGC

D:\sdk\groovy-1.7.6\bin>java -version

java version "1.6.0_26"

Java(TM) SE Runtime Environment (build 1.6.0_26-b03)

Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

D:\sdk\groovy-1.7.6\bin>groovysh

Groovy Shell (1.7.6, JVM: 1.6.0_26)

Type 'help' or '\h' for help.

-------------------------------------------------------------------------------

groovy:000> import java.lang.management.ManagementFactory

===> [import java.lang.management.ManagementFactory]

groovy:000> b = ManagementFactory.garbageCollectorMXBeans[1]

===> sun.management.GarbageCollectorImpl@b34b1

groovy:000> b.name

===> ConcurrentMarkSweep

groovy:000> b.collectionCount

===> 0

groovy:000> System.gc()

===> null

groovy:000> b.collectionCount

===> 2

groovy:000> System.gc()

===> null

groovy:000> b.collectionCount

===> 4

groovy:000> System.gc()

===> null

groovy:000> b.collectionCount

===> 6

groovy:000> System.gc()

===> null

groovy:000> b.collectionCount

===> 8

groovy:000> quit

D:\sdk\groovy-1.7.6\bin>set JAVA_HOME=\sdk\jdk1.6.0_20

D:\sdk\groovy-1.7.6\bin>groovysh

Groovy Shell (1.7.6, JVM: 1.6.0_20)

Type 'help' or '\h' for help.

-------------------------------------------------------------------------------

groovy:000> import java.lang.management.ManagementFactory

===> [import java.lang.management.ManagementFactory]

groovy:000> b = ManagementFactory.garbageCollectorMXBeans[1]

===> sun.management.GarbageCollectorImpl@1e8fa70

groovy:000> b.name

===> ConcurrentMarkSweep

groovy:000> b.collectionCount

===> 0

groovy:000> System.gc()

===> null

groovy:000> b.collectionCount

===> 1

groovy:000> System.gc()

===> null

groovy:000> b.collectionCount

===> 2

groovy:000> System.gc()

===> null

groovy:000> b.collectionCount

===> 3

groovy:000> quit

D:\sdk\groovy-1.7.6\bin>set JAVA_HOME=\sdk\jdk1.6.0_23

D:\sdk\groovy-1.7.6\bin>groovysh

Groovy Shell (1.7.6, JVM: 1.6.0_23)

Type 'help' or '\h' for help.

-------------------------------------------------------------------------------

groovy:000> import java.lang.management.ManagementFactory

===> [import java.lang.management.ManagementFactory]

groovy:000> b = ManagementFactory.garbageCollectorMXBeans[1]

===> sun.management.GarbageCollectorImpl@136bdda

groovy:000> b.name

===> ConcurrentMarkSweep

groovy:000> b.collectionCount

===> 0

groovy:000> System.gc()

===> null

groovy:000> b.collectionCount

===> 2

groovy:000> System.gc()

===> null

groovy:000> b.collectionCount

===> 4

groovy:000> System.gc()

===> null

groovy:000> b.collectionCount

===> 6

groovy:000> quit