Review request: 8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces

Stefan Karlsson 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.

http://cr.openjdk.java.net/~stefank/8024547/webrev.00

8024547: MaxMetaspaceSize should limit the committed memory used by the 
metaspaces
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 
1056768K
   class space    used 804K, capacity 822K, committed 896K, reserved 
1048576K

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.

thanks,
StefanK


More information about the hotspot-dev mailing list