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