Skip to content
Permalink
Browse files
8244384: @requires-related clean up in gc/metaspace/ tests
Reviewed-by: kbarrett, stefank
  • Loading branch information
iignatev committed May 5, 2020
1 parent c976be6 commit a899004d4eb5e7700b36c0ef0414905eecc373c7
Showing with 11 additions and 19 deletions.
  1. +0 −6 test/hotspot/jtreg/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java
  2. +11 −13 test/hotspot/jtreg/gc/metaspace/TestCapacityUntilGCWrapAround.java
@@ -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;
@@ -50,11 +49,6 @@
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")
@@ -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
@@ -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.