JDK-8024945 : Remove check on minimum size of MetaspaceSize
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-09-17
  • Updated: 2018-06-21
  • Resolved: 2016-07-05
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 b129Fixed
Description
MetaspaceSize is the amount of native memory allocated for metadata, when reached, will induce a garbage collection to attempt to unload classes.  It is not the size of any actual allocation but just
a number.  It does not have a minimum value.

Correct the alignment of MetaspaceSize and MaxMetaspaceSize.  They do not have the same
alignment requirements as the heap.  Page size alignment may be appropriate.
Comments
Removing these tests from TestMetaspaceSizeFlags.java. These tests expect initialization to fail with message "Too small initial Metaspace size". Initialization now fails with "OutOfMemoryError: Metaspace" testTooSmallInitialMetaspace(0, 0); testTooSmallInitialMetaspace(0, MAX_ALIGNMENT); Initialization does not fail. testTooSmallInitialMetaspace(MAX_ALIGNMENT, 0);
29-06-2016

Continue to align MetaspaceSize by _commit_alignment. The affect is that the GC threshold will be reached earlier than the user specified (or default) value of MetaspaceSize but changing the alignment will be a visible change to the application. Remove the alignment if a bug is created based on user complaint.
13-06-2016

Aligning MaxMetaspaceSize to the _reserve_alignment seems right since it makes it practical to use that much Metaspace (which is mmap'ed and would have a maximum that is so aligned).
08-06-2016