JDK-8025313 : MetaspaceMemoryPool incorrectly reports undefined size for max
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs25
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-09-24
  • Updated: 2013-10-08
  • Resolved: 2013-10-01
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 8 Other
8Fixed hs25Fixed
Description
Test name: gc/metaspace/TestMetaspaceMemoryPool.java 
java.lang.RuntimeException: Expected that -1 >= 4980736
	at com.oracle.java.testlibrary.Asserts.error(Asserts.java:392)
	at com.oracle.java.testlibrary.Asserts.assertTrue(Asserts.java:377)
	at com.oracle.java.testlibrary.Asserts.assertGreaterThanOrEqual(Asserts.java:210)
	at com.oracle.java.testlibrary.Asserts.assertGreaterThanOrEqual(Asserts.java:198)
	at com.oracle.java.testlibrary.Asserts.assertGTE(Asserts.java:179)
	at TestMetaspaceMemoryPool.verifyMemoryPool(TestMetaspaceMemoryPool.java:88)
	at TestMetaspaceMemoryPool.main(TestMetaspaceMemoryPool.java:44)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:491)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:724)
Comments
This is because the test was run with G1, and in g1CollectorPolicy.cpp we do: void G1CollectorPolicy::initialize_flags(): set_max_alignment(MAX3(card_table_alignment, min_alignment(), page_size)); CollectorPolicy::initialize_flags(); and in collectorPolicy.cpp we do: void CollectorPolicy::initialize_flags(): if (!is_size_aligned(MaxMetaspaceSize, max_alignment())) { FLAG_SET_ERGO(uintx, MaxMetaspaceSize, restricted_align_down(MaxMetaspaceSize, max_alignment())); } and finally in memoryPool.cpp we do: size_t MetaspacePool::calculate_max_size(): return FLAG_IS_CMDLINE(MaxMetaspaceSize) ? MaxMetaspaceSize : MemoryUsage::undefined_size(); Since 60m is not aligned according to card_table_alignment, we will adjust MaxMetaspaceSize in CollectorPolicy::initialize_flags with FLAG_SET_ERGO. FLAG_SET_ERGO will remove any trace of MaxMetaspaceSize ever being set on the command line, so calculate_max_size will (incorrectly) return MemoryUsage::undefined_size().
25-09-2013

Run details page: http://aurora.ru.oracle.com/functional/faces/RunDetails.xhtml?names=292760.JAVASE.PIT.VM-332#JT_HS%20[!jfr]%20%28jtreg%29_gc/metaspace/TestMetaspaceMemoryPool.java
24-09-2013