8217389: JTREG: Clean up, remove unused variable warnings
44
45 public static void main(String[] args) throws Exception {
46 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
47 "-XX:+UseG1GC",
48 "-Xms" + heapSize + "m",
49 "-Xmx" + heapSize + "m",
50 "-XX:G1HeapRegionSize=" + heapRegionSize + "m",
51 "-Xlog:gc",
52 HumongousObjectAllocator.class.getName());
53
54 OutputAnalyzer output = new OutputAnalyzer(pb.start());
55 output.shouldContain("Pause Young (Concurrent Start) (G1 Humongous Allocation)");
56 output.shouldHaveExitValue(0);
57 }
58
59 static class HumongousObjectAllocator {
60 public static void main(String [] args) {
61 for (int i = 0; i < heapSize; i++) {
62 // 131069 is the number of longs it takes to fill a heapRegion except
63 // for 8 bytes on 64 bit.
64 long[] largeObect = new long[131069];
65 }
66 }
67 }
68 }
69
|
44
45 public static void main(String[] args) throws Exception {
46 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
47 "-XX:+UseG1GC",
48 "-Xms" + heapSize + "m",
49 "-Xmx" + heapSize + "m",
50 "-XX:G1HeapRegionSize=" + heapRegionSize + "m",
51 "-Xlog:gc",
52 HumongousObjectAllocator.class.getName());
53
54 OutputAnalyzer output = new OutputAnalyzer(pb.start());
55 output.shouldContain("Pause Young (Concurrent Start) (G1 Humongous Allocation)");
56 output.shouldHaveExitValue(0);
57 }
58
59 static class HumongousObjectAllocator {
60 public static void main(String [] args) {
61 for (int i = 0; i < heapSize; i++) {
62 // 131069 is the number of longs it takes to fill a heapRegion except
63 // for 8 bytes on 64 bit.
64 @SuppressWarnings("unused")
65 long[] largeObect = new long[131069];
66 }
67 }
68 }
69 }
70
|