RFR(S): JDK-8048150: Allow easy configurations for large CDS archives

Calvin Cheung calvin.cheung at oracle.com
Tue Jul 29 23:08:52 UTC 2014


In JDK8, if one wants to create a large CDS archive (with a lot of 
classes), one needs to add VM options like these

-XX:SharedReadWriteSize=200000000
-XX:SharedReadOnlySize=200000000
-XX:SharedMiscDataSize=22000000
-XX:SharedMiscCodeSize=10000000

which is cumbersome and error-prone.

This change is to add the following 2 higher-level options to configure 
the sizes of the 4 regions (ro, rw, md, mc) of a shared archive.

-XX:+UseLargeSharedArchive (allow up to 300MB combined archive size)
-XX:+UseHugeSharedArchive  (allow up to 800MB combined archive size)

I tried a scenario with 19854 classes in the archive, the percentage of 
usage of the 4 regions are:
ro (40%), rw (55%), md (3%), mc (2%)

ro space:  57948760 [ 40.6% of total] out of 134217728 bytes [43.2% 
used] at 0x0000000800000000
rw space:  80259048 [ 56.2% of total] out of 134217728 bytes [59.8% 
used] at 0x0000000808000000
md space:   4102376 [  2.9% of total] out of  23068672 bytes [17.8% 
used] at 0x0000000810000000
mc space:    426525 [  0.3% of total] out of  23068672 bytes [ 1.8% 
used] at 0x0000000811600000
total   : 142736709 [100.0% of total] out of 314572800 bytes [45.4% used]

The usage distribution also holds for a simpler scenario with 2467 classes.

Bug: https://bugs.openjdk.java.net/browse/JDK-8048150

webrev: http://cr.openjdk.java.net/~ccheung/8048150/webrev/

Test:
     JPRT

thanks,
Calvin


More information about the hotspot-runtime-dev mailing list