22 *
23 */
24
25 package gc.g1.humongousObjects;
26
27 import jdk.test.lib.Asserts;
28 import sun.hotspot.WhiteBox;
29
30 import java.io.IOException;
31 import java.net.URL;
32 import java.net.URLClassLoader;
33 import java.nio.file.Files;
34 import java.nio.file.Path;
35 import java.nio.file.Paths;
36
37 /**
38 * @test gc.g1.humongousObjects.TestHumongousNonArrayAllocation
39 * @summary Checks that huge class' instances (ie with huge amount of fields) are allocated successfully
40 * @requires vm.gc.G1
41 * @requires vm.opt.G1HeapRegionSize == "null" | vm.opt.G1HeapRegionSize == "1M"
42 * @library /testlibrary /test/lib /
43 * @modules java.base/jdk.internal.misc
44 * @modules java.management
45 * @build sun.hotspot.WhiteBox
46 * gc.testlibrary.Helpers
47 * gc.g1.humongousObjects.G1SampleClass
48 * gc.g1.humongousObjects.TestHumongousNonArrayAllocation
49 *
50 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
51 * sun.hotspot.WhiteBox$WhiteBoxPermission
52 *
53 * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
54 * -XX:G1HeapRegionSize=1M
55 * gc.g1.humongousObjects.TestHumongousNonArrayAllocation LARGEST_NON_HUMONGOUS
56 *
57 * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
58 * -XX:G1HeapRegionSize=1M
59 * gc.g1.humongousObjects.TestHumongousNonArrayAllocation SMALLEST_HUMONGOUS
60 *
61 * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
62 * -XX:G1HeapRegionSize=1M
63 * gc.g1.humongousObjects.TestHumongousNonArrayAllocation ONE_REGION_HUMONGOUS
64 *
65 * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
66 * -XX:G1HeapRegionSize=1M
67 * gc.g1.humongousObjects.TestHumongousNonArrayAllocation TWO_REGION_HUMONGOUS
68 *
69 * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
|
22 *
23 */
24
25 package gc.g1.humongousObjects;
26
27 import jdk.test.lib.Asserts;
28 import sun.hotspot.WhiteBox;
29
30 import java.io.IOException;
31 import java.net.URL;
32 import java.net.URLClassLoader;
33 import java.nio.file.Files;
34 import java.nio.file.Path;
35 import java.nio.file.Paths;
36
37 /**
38 * @test gc.g1.humongousObjects.TestHumongousNonArrayAllocation
39 * @summary Checks that huge class' instances (ie with huge amount of fields) are allocated successfully
40 * @requires vm.gc.G1
41 * @requires vm.opt.G1HeapRegionSize == "null" | vm.opt.G1HeapRegionSize == "1M"
42 * @library /test/lib /
43 * @modules java.base/jdk.internal.misc
44 * @modules java.management
45 * @build sun.hotspot.WhiteBox
46 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
47 * sun.hotspot.WhiteBox$WhiteBoxPermission
48 *
49 * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
50 * -XX:G1HeapRegionSize=1M
51 * gc.g1.humongousObjects.TestHumongousNonArrayAllocation LARGEST_NON_HUMONGOUS
52 *
53 * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
54 * -XX:G1HeapRegionSize=1M
55 * gc.g1.humongousObjects.TestHumongousNonArrayAllocation SMALLEST_HUMONGOUS
56 *
57 * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
58 * -XX:G1HeapRegionSize=1M
59 * gc.g1.humongousObjects.TestHumongousNonArrayAllocation ONE_REGION_HUMONGOUS
60 *
61 * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
62 * -XX:G1HeapRegionSize=1M
63 * gc.g1.humongousObjects.TestHumongousNonArrayAllocation TWO_REGION_HUMONGOUS
64 *
65 * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
|