From 3d50eaa6edd6ae2b093a75fa203a706aef24701b Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Sat, 6 Apr 2024 02:25:04 +0000 Subject: [PATCH] 8329784: Run MaxMetaspaceSizeTest.java with -Xshare:off Reviewed-by: ccheung, matsaave --- .../jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java b/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java index 76c24eb1d25..b2ff8ed9bde 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java +++ b/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,14 +36,14 @@ import jdk.test.lib.process.OutputAnalyzer; public class MaxMetaspaceSizeTest { public static void main(String... args) throws Exception { ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( + "-Xshare:off", "-Xmx1g", "-XX:MaxMetaspaceSize=4K", "-XX:+UseCompressedClassPointers", "-XX:CompressedClassSpaceSize=1g", "--version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - // We do not explicitly limit MaxMetaspaceSize to a lower minimum. User can get as low as he wants. - // However, you most certainly will hit either one of + // -Xshare:off --version loads hundreds of classes and will hit either one of // "OutOfMemoryError: Metaspace" or // "OutOfMemoryError: Compressed class space" output.shouldMatch("OutOfMemoryError.*(Compressed class space|Metaspace)");