JDK-8163413 : gc/metaspace/TestMetaspacePerfCounters failure
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-08-08
  • Updated: 2017-07-26
  • Resolved: 2016-08-22
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 9
9 b135Fixed
Related Reports
Relates :  
Description
Started failing in compiler nightlies after a pull from main.

java.lang.RuntimeException: (assert failed: 4505600 >= 7102464)
	at jdk.test.lib.Asserts.error(Asserts.java:447)
	at jdk.test.lib.Asserts.assertTrue(Asserts.java:374)
	at jdk.test.lib.Asserts.assertGreaterThanOrEqual(Asserts.java:209)
	at jdk.test.lib.Asserts.assertGreaterThanOrEqual(Asserts.java:197)
	at jdk.test.lib.Asserts.assertGTE(Asserts.java:179)
	at TestMetaspacePerfCounters.checkPerfCounters(TestMetaspacePerfCounters.java:76)
	at TestMetaspacePerfCounters.main(TestMetaspacePerfCounters.java:56)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:533)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
	at java.lang.Thread.run(java.base@9-internal/Thread.java:843)

Comments
Bugs found by nightly testing. Verified by passed nightly.
26-07-2017

Looked a bit at this and was able to reproduce by adding a System.gc() between the calls to get capacity and maxCapacity. The assert that is failing is the one that checks that maxCapacity > capacity. The fact that maxCapacity is not a constant makes it possible for the assert to fail and the value is updated during a GC, hence the increased risk of failure when adding a System.gc() before getting the value.
12-08-2016