JDK-8205344 : TraceMemoryManagerStats changes in JDK-8195115 broke ZGC
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 11
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2018-06-19
  • Updated: 2018-07-05
  • Resolved: 2018-06-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b19Fixed
Related Reports
Relates :  
Description
Test: gc/TestFullGCCount.java

#section:main
----------messages:(5/242)----------
command: main -Xlog:gc TestFullGCCount
reason: User specified action: run main/othervm -Xlog:gc TestFullGCCount 
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules java.management
elapsed time (seconds): 1.156
----------configuration:(3/43)----------
Boot Layer
  add modules: java.management

----------System.out:(22/1536)----------
[0.109s][info][gc] Using The Z Garbage Collector
[0.724s][info][gc] GC(0) Garbage Collection (System.gc()) 10M(1%)->4M(0%)
[0.738s][info][gc] GC(1) Garbage Collection (System.gc()) 6M(0%)->8M(0%)
[0.747s][info][gc] GC(2) Garbage Collection (System.gc()) 8M(0%)->12M(1%)
[0.758s][info][gc] GC(3) Garbage Collection (System.gc()) 12M(1%)->8M(0%)
[0.773s][info][gc] GC(4) Garbage Collection (System.gc()) 8M(0%)->4M(0%)
[0.784s][info][gc] GC(5) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.818s][info][gc] GC(6) Garbage Collection (System.gc()) 4M(0%)->6M(0%)
[0.830s][info][gc] GC(7) Garbage Collection (System.gc()) 6M(0%)->4M(0%)
[0.841s][info][gc] GC(8) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.851s][info][gc] GC(9) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.861s][info][gc] GC(10) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.870s][info][gc] GC(11) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.877s][info][gc] GC(12) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.883s][info][gc] GC(13) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.889s][info][gc] GC(14) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.895s][info][gc] GC(15) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.901s][info][gc] GC(16) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.907s][info][gc] GC(17) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.913s][info][gc] GC(18) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
[0.919s][info][gc] GC(19) Garbage Collection (System.gc()) 4M(0%)->4M(0%)
Checking: ZGC
----------System.err:(33/1772)----------
Collector 'ZGC' has increment 3 at iteration 0
Collector 'ZGC' has increment 3 at iteration 1
Collector 'ZGC' has increment 3 at iteration 2
Collector 'ZGC' has increment 3 at iteration 3
Collector 'ZGC' has increment 3 at iteration 4
Collector 'ZGC' has increment 3 at iteration 5
Collector 'ZGC' has increment 3 at iteration 6
Collector 'ZGC' has increment 3 at iteration 7
Collector 'ZGC' has increment 3 at iteration 8
Collector 'ZGC' has increment 3 at iteration 9
Collector 'ZGC' has increment 3 at iteration 10
Collector 'ZGC' has increment 3 at iteration 11
Collector 'ZGC' has increment 3 at iteration 12
Collector 'ZGC' has increment 3 at iteration 13
Collector 'ZGC' has increment 3 at iteration 14
Collector 'ZGC' has increment 3 at iteration 15
Collector 'ZGC' has increment 3 at iteration 16
Collector 'ZGC' has increment 3 at iteration 17
Collector 'ZGC' has increment 3 at iteration 18

java.lang.RuntimeException: FAILED: System.gc collections miscounted.
	at TestFullGCCount.main(TestFullGCCount.java:85)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
	at java.base/java.lang.Thread.run(Thread.java:832)

JavaTest Message: Test threw exception: java.lang.RuntimeException: FAILED: System.gc collections miscounted.
JavaTest Message: shutting down test
Comments
Per has also associated the following tests with this bug's failure mode: java/lang/management/MemoryMXBean/CollectionUsageThreshold.java java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java com/sun/management/GarbageCollectorMXBean/LastGCInfo.java so if you have a repo that does not contain a fix for this bug... now you know that these tests can also fail do to it...
20-06-2018

JDK-8195115 changed the TraceMemoryManagerStats constructor interface but failed to take ZGC into account.
19-06-2018