|
30 | 30 | * @library /test/lib
|
31 | 31 | * @modules java.base/jdk.internal.misc
|
32 | 32 | * java.management
|
| 33 | + * @requires vm.bits == 32 |
33 | 34 | * @build sun.hotspot.WhiteBox
|
34 | 35 | * @run driver ClassFileInstaller sun.hotspot.WhiteBox
|
35 | 36 | * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI gc.metaspace.TestCapacityUntilGCWrapAround
|
|
38 | 39 | import sun.hotspot.WhiteBox;
|
39 | 40 |
|
40 | 41 | import jdk.test.lib.Asserts;
|
41 |
| -import jdk.test.lib.Platform; |
42 | 42 |
|
43 | 43 | public class TestCapacityUntilGCWrapAround {
|
44 | 44 | private static long MB = 1024 * 1024;
|
45 | 45 | private static long GB = 1024 * MB;
|
46 | 46 | private static long MAX_UINT = 4 * GB - 1; // On 32-bit platforms
|
47 | 47 |
|
48 | 48 | public static void main(String[] args) {
|
49 |
| - if (Platform.is32bit()) { |
50 |
| - WhiteBox wb = WhiteBox.getWhiteBox(); |
51 |
| - |
52 |
| - long before = wb.metaspaceCapacityUntilGC(); |
53 |
| - // Now force possible overflow of capacity_until_GC. |
54 |
| - long after = wb.incMetaspaceCapacityUntilGC(MAX_UINT); |
55 |
| - |
56 |
| - Asserts.assertGTE(after, before, |
57 |
| - "Increasing with MAX_UINT should not cause wrap around: " + after + " < " + before); |
58 |
| - Asserts.assertLTE(after, MAX_UINT, |
59 |
| - "Increasing with MAX_UINT should not cause value larger than MAX_UINT:" + after); |
60 |
| - } |
| 49 | + WhiteBox wb = WhiteBox.getWhiteBox(); |
| 50 | + |
| 51 | + long before = wb.metaspaceCapacityUntilGC(); |
| 52 | + // Now force possible overflow of capacity_until_GC. |
| 53 | + long after = wb.incMetaspaceCapacityUntilGC(MAX_UINT); |
| 54 | + |
| 55 | + Asserts.assertGTE(after, before, |
| 56 | + "Increasing with MAX_UINT should not cause wrap around: " + after + " < " + before); |
| 57 | + Asserts.assertLTE(after, MAX_UINT, |
| 58 | + "Increasing with MAX_UINT should not cause value larger than MAX_UINT:" + after); |
61 | 59 | }
|
62 | 60 | }
|
0 commit comments