< prev index next >

test/runtime/SharedArchiveFile/LimitSharedSizes.java

Print this page


 110         // It should result in an error message either like the following #1:
 111         // The shared miscellaneous code space is not large enough
 112         // to preload requested classes. Use -XX:SharedMiscCodeSize=
 113         // to increase the initial size of shared miscellaneous code space.
 114         // or #2:
 115         // The shared miscellaneous code space is outside the allowed range
 116         new SharedSizeTestData(Region.RO, "4M"),
 117         new SharedSizeTestData(Region.RW, "4M"),
 118         new SharedSizeTestData(Region.MD, "50k"),
 119         new SharedSizeTestData(Region.MC, "20k"),
 120 
 121         // these values are larger than default ones, and should
 122         // be acceptable and not cause failure
 123         new SharedSizeTestData(Region.RO, "20M", Result.VALID),
 124         new SharedSizeTestData(Region.RW, "20M", Result.VALID),
 125         new SharedSizeTestData(Region.MD, "20M", Result.VALID),
 126         new SharedSizeTestData(Region.MC, "20M", Result.VALID),
 127 
 128         // test with sizes which just meet the minimum required sizes
 129         // the following tests also attempt to use the shared archive
 130         new SharedSizeTestData(Region.RO, Platform.is64bit() ? "10M":"9M", Result.VALID_ARCHIVE),
 131         new SharedSizeTestData(Region.RW, Platform.is64bit() ? "12M":"7M", Result.VALID_ARCHIVE),
 132         new SharedSizeTestData(Region.MD, Platform.is64bit() ? "4M":"2M", Result.VALID_ARCHIVE),
 133         new SharedSizeTestData(Region.MC, "120k", Result.VALID_ARCHIVE),
 134     };
 135 
 136     public static void main(String[] args) throws Exception {
 137         int counter = 0;
 138         for (SharedSizeTestData td : testTable) {
 139             String fileName = "LimitSharedSizes" + counter + ".jsa";
 140             counter++;
 141 
 142             String option = td.optionName + "=" + td.optionValue;
 143             System.out.println("testing option number <" + counter + ">");
 144             System.out.println("testing option <" + option + ">");
 145 
 146             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
 147                "-XX:+UnlockDiagnosticVMOptions",
 148                "-XX:SharedArchiveFile=./" + fileName,
 149                option,
 150                "-Xshare:dump");




 110         // It should result in an error message either like the following #1:
 111         // The shared miscellaneous code space is not large enough
 112         // to preload requested classes. Use -XX:SharedMiscCodeSize=
 113         // to increase the initial size of shared miscellaneous code space.
 114         // or #2:
 115         // The shared miscellaneous code space is outside the allowed range
 116         new SharedSizeTestData(Region.RO, "4M"),
 117         new SharedSizeTestData(Region.RW, "4M"),
 118         new SharedSizeTestData(Region.MD, "50k"),
 119         new SharedSizeTestData(Region.MC, "20k"),
 120 
 121         // these values are larger than default ones, and should
 122         // be acceptable and not cause failure
 123         new SharedSizeTestData(Region.RO, "20M", Result.VALID),
 124         new SharedSizeTestData(Region.RW, "20M", Result.VALID),
 125         new SharedSizeTestData(Region.MD, "20M", Result.VALID),
 126         new SharedSizeTestData(Region.MC, "20M", Result.VALID),
 127 
 128         // test with sizes which just meet the minimum required sizes
 129         // the following tests also attempt to use the shared archive
 130         new SharedSizeTestData(Region.RO, Platform.is64bit() ? "14M":"9M", Result.VALID_ARCHIVE),
 131         new SharedSizeTestData(Region.RW, Platform.is64bit() ? "12M":"7M", Result.VALID_ARCHIVE),
 132         new SharedSizeTestData(Region.MD, Platform.is64bit() ? "4M":"2M", Result.VALID_ARCHIVE),
 133         new SharedSizeTestData(Region.MC, "120k", Result.VALID_ARCHIVE),
 134     };
 135 
 136     public static void main(String[] args) throws Exception {
 137         int counter = 0;
 138         for (SharedSizeTestData td : testTable) {
 139             String fileName = "LimitSharedSizes" + counter + ".jsa";
 140             counter++;
 141 
 142             String option = td.optionName + "=" + td.optionValue;
 143             System.out.println("testing option number <" + counter + ">");
 144             System.out.println("testing option <" + option + ">");
 145 
 146             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
 147                "-XX:+UnlockDiagnosticVMOptions",
 148                "-XX:SharedArchiveFile=./" + fileName,
 149                option,
 150                "-Xshare:dump");


< prev index next >