Skip to content

Commit

Permalink
8244384: @requires-related clean up in gc/metaspace/ tests
Browse files Browse the repository at this point in the history
Reviewed-by: kbarrett, stefank
  • Loading branch information
iignatev committed May 5, 2020
1 parent c976be6 commit a899004
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
Expand Up @@ -36,7 +36,6 @@
*/

import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.Platform;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.SA.SATestUtils;
Expand All @@ -50,11 +49,6 @@ public class CompressedClassSpaceSizeInJmapHeap {
public static void main(String[] args) throws Exception {
SATestUtils.skipIfCannotAttach(); // throws SkippedException if attach not expected to work.

if (!Platform.is64bit()) {
// Compressed Class Space is only available on 64-bit JVMs
return;
}

String pid = Long.toString(ProcessTools.getProcessId());

JDKToolLauncher jmap = JDKToolLauncher.create("jhsdb")
Expand Down
24 changes: 11 additions & 13 deletions test/hotspot/jtreg/gc/metaspace/TestCapacityUntilGCWrapAround.java
Expand Up @@ -30,6 +30,7 @@
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
* @requires vm.bits == 32
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI gc.metaspace.TestCapacityUntilGCWrapAround
Expand All @@ -38,25 +39,22 @@
import sun.hotspot.WhiteBox;

import jdk.test.lib.Asserts;
import jdk.test.lib.Platform;

public class TestCapacityUntilGCWrapAround {
private static long MB = 1024 * 1024;
private static long GB = 1024 * MB;
private static long MAX_UINT = 4 * GB - 1; // On 32-bit platforms

public static void main(String[] args) {
if (Platform.is32bit()) {
WhiteBox wb = WhiteBox.getWhiteBox();

long before = wb.metaspaceCapacityUntilGC();
// Now force possible overflow of capacity_until_GC.
long after = wb.incMetaspaceCapacityUntilGC(MAX_UINT);

Asserts.assertGTE(after, before,
"Increasing with MAX_UINT should not cause wrap around: " + after + " < " + before);
Asserts.assertLTE(after, MAX_UINT,
"Increasing with MAX_UINT should not cause value larger than MAX_UINT:" + after);
}
WhiteBox wb = WhiteBox.getWhiteBox();

long before = wb.metaspaceCapacityUntilGC();
// Now force possible overflow of capacity_until_GC.
long after = wb.incMetaspaceCapacityUntilGC(MAX_UINT);

Asserts.assertGTE(after, before,
"Increasing with MAX_UINT should not cause wrap around: " + after + " < " + before);
Asserts.assertLTE(after, MAX_UINT,
"Increasing with MAX_UINT should not cause value larger than MAX_UINT:" + after);
}
}

0 comments on commit a899004

Please sign in to comment.