107 large4 = new int[M - 20];
108 genGarbage(large1);
109 // Make sure that the compiler cannot completely remove
110 // the allocation of the large object until here.
111 System.out.println(large1 + " " + large2 + " " + large3 + " " + large4);
112 }
113
114 // Keep the reference to the first object alive.
115 System.out.println(ref_from_stack);
116 }
117 }
118
119 public class TestEagerReclaimHumongousRegionsClearMarkBits {
120 public static void main(String[] args) throws Exception {
121 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
122 "-XX:+UseG1GC",
123 "-Xms128M",
124 "-Xmx128M",
125 "-Xmn2M",
126 "-XX:G1HeapRegionSize=1M",
127 "-XX:InitiatingHeapOccupancyPercent=0", // Want to have as much as possible initial marks.
128 "-Xlog:gc",
129 "-XX:+UnlockDiagnosticVMOptions",
130 "-XX:+VerifyAfterGC",
131 "-XX:ConcGCThreads=1", // Want to make marking as slow as possible.
132 "-XX:+IgnoreUnrecognizedVMOptions", // G1VerifyBitmaps is develop only.
133 "-XX:+G1VerifyBitmaps",
134 TestEagerReclaimHumongousRegionsClearMarkBitsReclaimRegionFast.class.getName());
135 OutputAnalyzer output = new OutputAnalyzer(pb.start());
136 output.shouldHaveExitValue(0);
137 }
138 }
139
|
107 large4 = new int[M - 20];
108 genGarbage(large1);
109 // Make sure that the compiler cannot completely remove
110 // the allocation of the large object until here.
111 System.out.println(large1 + " " + large2 + " " + large3 + " " + large4);
112 }
113
114 // Keep the reference to the first object alive.
115 System.out.println(ref_from_stack);
116 }
117 }
118
119 public class TestEagerReclaimHumongousRegionsClearMarkBits {
120 public static void main(String[] args) throws Exception {
121 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
122 "-XX:+UseG1GC",
123 "-Xms128M",
124 "-Xmx128M",
125 "-Xmn2M",
126 "-XX:G1HeapRegionSize=1M",
127 "-XX:InitiatingHeapOccupancyPercent=0", // Want to have as much as possible mark cycles.
128 "-Xlog:gc",
129 "-XX:+UnlockDiagnosticVMOptions",
130 "-XX:+VerifyAfterGC",
131 "-XX:ConcGCThreads=1", // Want to make marking as slow as possible.
132 "-XX:+IgnoreUnrecognizedVMOptions", // G1VerifyBitmaps is develop only.
133 "-XX:+G1VerifyBitmaps",
134 TestEagerReclaimHumongousRegionsClearMarkBitsReclaimRegionFast.class.getName());
135 OutputAnalyzer output = new OutputAnalyzer(pb.start());
136 output.shouldHaveExitValue(0);
137 }
138 }
139
|