21 * questions.
22 *
23 */
24
25 package gc.g1.humongousObjects;
26
27 import gc.testlibrary.Helpers;
28 import jdk.test.lib.Asserts;
29 import sun.hotspot.WhiteBox;
30
31 import java.lang.ref.Reference;
32 import java.lang.ref.ReferenceQueue;
33 import java.lang.ref.SoftReference;
34 import java.lang.ref.WeakReference;
35
36 /**
37 * @test TestObjectCollected
38 * @summary checks that after different type of GCs weak/soft references to humongous object behave correspondingly to
39 * actual object behavior
40 * @requires vm.gc.G1
41 * @library /testlibrary /test/lib /
42 * @modules java.base/jdk.internal.misc
43 * @modules java.management
44 * @build sun.hotspot.WhiteBox
45 * gc.testlibrary.Helpers
46 * gc.g1.humongousObjects.TestObjectCollected
47 *
48 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
49 * sun.hotspot.WhiteBox$WhiteBoxPermission
50 *
51 * @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
52 * -XX:+WhiteBoxAPI -Xbootclasspath/a:. -Xms200m -Xmx200m -Xlog:gc
53 * -XX:InitiatingHeapOccupancyPercent=100 -XX:G1HeapRegionSize=1M -Xlog:gc=info:file=TestObjectCollected.gc.log
54 * gc.g1.humongousObjects.TestObjectCollected
55 */
56
57
58 /**
59 * Test checks that after different type of GCs weak/soft references to humongous object behave correspondingly to
60 * actual object behavior.
61 * So if object was collected, reference.get() should return null and vice versa
62 * Since we check humongous objects after such an object is collected the region where it was allocated becomes free
63 * or/and change type to non-humongous. Two WhiteBox method were used - first returns if a region containing certain
64 * address is free and second - if a region containing certain address is humongous
65 */
66
67 public class TestObjectCollected {
|
21 * questions.
22 *
23 */
24
25 package gc.g1.humongousObjects;
26
27 import gc.testlibrary.Helpers;
28 import jdk.test.lib.Asserts;
29 import sun.hotspot.WhiteBox;
30
31 import java.lang.ref.Reference;
32 import java.lang.ref.ReferenceQueue;
33 import java.lang.ref.SoftReference;
34 import java.lang.ref.WeakReference;
35
36 /**
37 * @test TestObjectCollected
38 * @summary checks that after different type of GCs weak/soft references to humongous object behave correspondingly to
39 * actual object behavior
40 * @requires vm.gc.G1
41 * @library /test/lib /
42 * @modules java.base/jdk.internal.misc
43 * @modules java.management
44 * @build sun.hotspot.WhiteBox
45 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
46 * sun.hotspot.WhiteBox$WhiteBoxPermission
47 *
48 * @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
49 * -XX:+WhiteBoxAPI -Xbootclasspath/a:. -Xms200m -Xmx200m -Xlog:gc
50 * -XX:InitiatingHeapOccupancyPercent=100 -XX:G1HeapRegionSize=1M -Xlog:gc=info:file=TestObjectCollected.gc.log
51 * gc.g1.humongousObjects.TestObjectCollected
52 */
53
54
55 /**
56 * Test checks that after different type of GCs weak/soft references to humongous object behave correspondingly to
57 * actual object behavior.
58 * So if object was collected, reference.get() should return null and vice versa
59 * Since we check humongous objects after such an object is collected the region where it was allocated becomes free
60 * or/and change type to non-humongous. Two WhiteBox method were used - first returns if a region containing certain
61 * address is free and second - if a region containing certain address is humongous
62 */
63
64 public class TestObjectCollected {
|