15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.util.List;
25 import java.lang.management.*;
26 import jdk.test.lib.Platform;
27 import jdk.test.lib.process.ProcessTools;
28 import jdk.test.lib.process.OutputAnalyzer;
29 import static jdk.test.lib.Asserts.*;
30
31 /* @test TestMetaspaceMemoryPool
32 * @bug 8000754
33 * @summary Tests that a MemoryPoolMXBeans is created for metaspace and that a
34 * MemoryManagerMXBean is created.
35 * @requires vm.opt.final.UseCompressedOops
36 * @library /test/lib
37 * @modules java.base/jdk.internal.misc
38 * java.management
39 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops TestMetaspaceMemoryPool
40 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:MaxMetaspaceSize=60m TestMetaspaceMemoryPool
41 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers TestMetaspaceMemoryPool
42 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:CompressedClassSpaceSize=60m TestMetaspaceMemoryPool
43 */
44 public class TestMetaspaceMemoryPool {
45 public static void main(String[] args) {
46 verifyThatMetaspaceMemoryManagerExists();
47
48 boolean isMetaspaceMaxDefined = InputArguments.containsPrefix("-XX:MaxMetaspaceSize");
49 verifyMemoryPool(getMemoryPool("Metaspace"), isMetaspaceMaxDefined);
50
51 if (Platform.is64bit()) {
52 if (InputArguments.contains("-XX:+UseCompressedOops")) {
53 MemoryPoolMXBean cksPool = getMemoryPool("Compressed Class Space");
54 verifyMemoryPool(cksPool, true);
55 }
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.util.List;
25 import java.lang.management.*;
26 import jdk.test.lib.Platform;
27 import jdk.test.lib.process.ProcessTools;
28 import jdk.test.lib.process.OutputAnalyzer;
29 import static jdk.test.lib.Asserts.*;
30
31 /* @test TestMetaspaceMemoryPool
32 * @bug 8000754
33 * @summary Tests that a MemoryPoolMXBeans is created for metaspace and that a
34 * MemoryManagerMXBean is created.
35 * @requires vm.bits == 64 & vm.opt.final.UseCompressedOops
36 * @library /test/lib
37 * @modules java.base/jdk.internal.misc
38 * java.management
39 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops TestMetaspaceMemoryPool
40 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:MaxMetaspaceSize=60m TestMetaspaceMemoryPool
41 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers TestMetaspaceMemoryPool
42 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:CompressedClassSpaceSize=60m TestMetaspaceMemoryPool
43 */
44 public class TestMetaspaceMemoryPool {
45 public static void main(String[] args) {
46 verifyThatMetaspaceMemoryManagerExists();
47
48 boolean isMetaspaceMaxDefined = InputArguments.containsPrefix("-XX:MaxMetaspaceSize");
49 verifyMemoryPool(getMemoryPool("Metaspace"), isMetaspaceMaxDefined);
50
51 if (Platform.is64bit()) {
52 if (InputArguments.contains("-XX:+UseCompressedOops")) {
53 MemoryPoolMXBean cksPool = getMemoryPool("Compressed Class Space");
54 verifyMemoryPool(cksPool, true);
55 }
|