17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test TestNoEagerReclaimOfHumongousRegions
26 * @bug 8139424
27 * @summary Test to check that a live humongous object is not eagerly reclaimed. This is a regression test for
28 * 8139424 and the test will crash if an eager reclaim occur. The test is not 100% deterministic and
29 * might pass even if there are problems in the code, but it will never crash unless there is a problem.
30 * @requires vm.gc=="G1" | vm.gc=="null"
31 * @key gc
32 * @library /testlibrary /test/lib
33 * @modules java.base/sun.misc
34 * @build TestNoEagerReclaimOfHumongousRegions
35 * @run main ClassFileInstaller sun.hotspot.WhiteBox
36 * sun.hotspot.WhiteBox$WhiteBoxPermission
37 * @run main/othervm -Xbootclasspath/a:. -XX:+PrintGC -XX:+UseG1GC -XX:MaxTenuringThreshold=0 -XX:G1RSetSparseRegionEntries=32 -XX:G1HeapRegionSize=1m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+G1TraceEagerReclaimHumongousObjects TestNoEagerReclaimOfHumongousRegions
38 */
39
40 import java.util.LinkedList;
41
42 import sun.hotspot.WhiteBox;
43
44 public class TestNoEagerReclaimOfHumongousRegions {
45 // Helper class to keep reference to humongous byte[].
46 static class LargeRef {
47 private byte[] _ref;
48
49 LargeRef(byte[] ref) {
50 _ref = ref;
51 }
52
53 byte[] ref() { return _ref; }
54 }
55
56 static LargeRef humongous_reference_holder;
57
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test TestNoEagerReclaimOfHumongousRegions
26 * @bug 8139424
27 * @summary Test to check that a live humongous object is not eagerly reclaimed. This is a regression test for
28 * 8139424 and the test will crash if an eager reclaim occur. The test is not 100% deterministic and
29 * might pass even if there are problems in the code, but it will never crash unless there is a problem.
30 * @requires vm.gc=="G1" | vm.gc=="null"
31 * @key gc
32 * @library /testlibrary /test/lib
33 * @modules java.base/sun.misc
34 * @build TestNoEagerReclaimOfHumongousRegions
35 * @run main ClassFileInstaller sun.hotspot.WhiteBox
36 * sun.hotspot.WhiteBox$WhiteBoxPermission
37 * @run main/othervm -Xbootclasspath/a:. -Xlog:gc,gc+humongous=debug -XX:+UseG1GC -XX:MaxTenuringThreshold=0 -XX:G1RSetSparseRegionEntries=32 -XX:G1HeapRegionSize=1m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestNoEagerReclaimOfHumongousRegions
38 */
39
40 import java.util.LinkedList;
41
42 import sun.hotspot.WhiteBox;
43
44 public class TestNoEagerReclaimOfHumongousRegions {
45 // Helper class to keep reference to humongous byte[].
46 static class LargeRef {
47 private byte[] _ref;
48
49 LargeRef(byte[] ref) {
50 _ref = ref;
51 }
52
53 byte[] ref() { return _ref; }
54 }
55
56 static LargeRef humongous_reference_holder;
57
|