Review request: 8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefan.karlsson at oracle.com
Mon Oct 7 23:21:31 PDT 2013
Please, review this patch to limit the committed Metaspace memory
against the MaxMetaspaceSize flag.
8024547: MaxMetaspaceSize should limit the committed memory used by the
Reviewed-by: TBD1, TBD2
To simplify the code, the patch is strict about the alignments used to
commit and reserve memory in the metaspaces. The Metaspace VirtualSpaces
always have addresses and sizes that are aligned against
Metaspace::reserve_alignment(). The reserve alignment is
os::vm_allocation_granularity() if small pages are used or
os::large_page_size() if large pages are used in the Metaspace. The
memory is always committed in regions that are size aligned against
Metaspace::commit_alignment(). The commit alignment is os:page_size() if
small pages are used or os::large_page_size() if late pages are used in
the Metaspace. The user can specify the flag
-XX:+UseLargePagesInMetaspace to turn on large pages in the metaspaces.
The flag initialization was moved out of the CollectorPolicy class. The
Metaspace specific flags have been changed to be commit/reserve aligned
instead of using heap specific alignments.
The output from PrintHeapAtGC has been changed. The redundant "data
space" section has been removed. All of used, capacity, committed and
reserved are printed. Example:
Metaspace used 7644K, capacity 7700K, committed 7808K, reserved
class space used 804K, capacity 822K, committed 896K, reserved
Thanks go out to the engineers who have helped out with this bug: Erik,
Mikael and Bengt for helping out with parts of the code and testing.
Bengt, Coleen, Jesper and Jon for pre-reviewing the changes and
providing early feedback.
More information about the hotspot-dev