1
1
/*
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.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
32
32
* @library /test/lib
33
33
* @modules java.base/jdk.internal.misc
34
34
* java.management
35
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompressedClassSpaceSize=50m gc.metaspace.CompressedClassSpaceSizeInJmapHeap
35
+ * @run main/timeout=240 gc.metaspace.CompressedClassSpaceSizeInJmapHeap
36
36
*/
37
37
38
38
import jdk .test .lib .JDKToolLauncher ;
39
39
import jdk .test .lib .Platform ;
40
+ import jdk .test .lib .apps .LingeredApp ;
40
41
import jdk .test .lib .process .OutputAnalyzer ;
41
42
import jdk .test .lib .process .ProcessTools ;
42
43
import jdk .test .lib .SA .SATestUtils ;
@@ -55,7 +56,9 @@ public static void main(String[] args) throws Exception {
55
56
return ;
56
57
}
57
58
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 ());
59
62
60
63
JDKToolLauncher jmap = JDKToolLauncher .create ("jhsdb" )
61
64
.addToolArg ("jmap" )
@@ -75,6 +78,8 @@ public static void main(String[] args) throws Exception {
75
78
OutputAnalyzer output = new OutputAnalyzer (read (out ));
76
79
output .shouldContain ("CompressedClassSpaceSize = 52428800 (50.0MB)" );
77
80
out .delete ();
81
+
82
+ LingeredApp .stopApp (theApp );
78
83
}
79
84
80
85
private static void run (ProcessBuilder pb ) throws Exception {
0 commit comments