Skip to content

Commit b88cd77

Browse files
committed
8298073: gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java causes test task timeout on macosx
8241293: CompressedClassSpaceSizeInJmapHeap.java time out after 8 minutes Reviewed-by: phh Backport-of: 99a6c47855ad82e81a80726cf3aa4522c547716d
1 parent 9d7bb60 commit b88cd77

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/hotspot/jtreg/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -32,11 +32,12 @@
3232
* @library /test/lib
3333
* @modules java.base/jdk.internal.misc
3434
* java.management
35-
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompressedClassSpaceSize=50m gc.metaspace.CompressedClassSpaceSizeInJmapHeap
35+
* @run main/timeout=240 gc.metaspace.CompressedClassSpaceSizeInJmapHeap
3636
*/
3737

3838
import jdk.test.lib.JDKToolLauncher;
3939
import jdk.test.lib.Platform;
40+
import jdk.test.lib.apps.LingeredApp;
4041
import jdk.test.lib.process.OutputAnalyzer;
4142
import jdk.test.lib.process.ProcessTools;
4243
import jdk.test.lib.SA.SATestUtils;
@@ -55,7 +56,9 @@ public static void main(String[] args) throws Exception {
5556
return;
5657
}
5758

58-
String pid = Long.toString(ProcessTools.getProcessId());
59+
LingeredApp theApp = new LingeredApp();
60+
LingeredApp.startApp(List.of("-XX:CompressedClassSpaceSize=50m"), theApp);
61+
String pid = Long.toString(theApp.getPid());
5962

6063
JDKToolLauncher jmap = JDKToolLauncher.create("jhsdb")
6164
.addToolArg("jmap")
@@ -75,6 +78,8 @@ public static void main(String[] args) throws Exception {
7578
OutputAnalyzer output = new OutputAnalyzer(read(out));
7679
output.shouldContain("CompressedClassSpaceSize = 52428800 (50.0MB)");
7780
out.delete();
81+
82+
LingeredApp.stopApp(theApp);
7883
}
7984

8085
private static void run(ProcessBuilder pb) throws Exception {

0 commit comments

Comments
 (0)