8306696: Remove MetaspaceReclaimPolicy=aggressive and obsolete MetaspaceReclaimPolicy
Reviewed-by: dholmes, rkennke, coleenp
This commit is contained in:
parent
eb3af8abe9
commit
0b5c504ad0
@ -116,7 +116,6 @@ static void print_settings(outputStream* out, size_t scale) {
|
||||
print_human_readable_size(out, MetaspaceGC::capacity_until_GC(), scale);
|
||||
out->cr();
|
||||
out->print_cr("CDS: %s", (UseSharedSpaces ? "on" : (DumpSharedSpaces ? "dump" : "off")));
|
||||
out->print_cr("MetaspaceReclaimPolicy: %s", MetaspaceReclaimPolicy);
|
||||
Settings::print_on(out);
|
||||
}
|
||||
|
||||
|
@ -36,29 +36,15 @@
|
||||
|
||||
namespace metaspace {
|
||||
|
||||
size_t Settings::_commit_granule_bytes = 0;
|
||||
size_t Settings::_commit_granule_words = 0;
|
||||
|
||||
DEBUG_ONLY(bool Settings::_use_allocation_guard = false;)
|
||||
|
||||
void Settings::ergo_initialize() {
|
||||
if (strcmp(MetaspaceReclaimPolicy, "aggressive") == 0) {
|
||||
log_info(metaspace)("Initialized with strategy: aggressive reclaim.");
|
||||
// Set the granule size rather small; may increase
|
||||
// mapping fragmentation but also increase chance to uncommit.
|
||||
_commit_granule_bytes = MAX2(os::vm_page_size(), 16 * K);
|
||||
_commit_granule_words = _commit_granule_bytes / BytesPerWord;
|
||||
} else if (strcmp(MetaspaceReclaimPolicy, "balanced") == 0) {
|
||||
log_info(metaspace)("Initialized with strategy: balanced reclaim.");
|
||||
_commit_granule_bytes = MAX2(os::vm_page_size(), 64 * K);
|
||||
_commit_granule_words = _commit_granule_bytes / BytesPerWord;
|
||||
} else {
|
||||
vm_exit_during_initialization("Invalid value for MetaspaceReclaimPolicy: \"%s\".", MetaspaceReclaimPolicy);
|
||||
}
|
||||
|
||||
// Sanity checks.
|
||||
// Granules must be a multiple of page size, and a power-2-value.
|
||||
assert(_commit_granule_bytes >= os::vm_page_size() &&
|
||||
is_aligned(_commit_granule_bytes, os::vm_page_size()),
|
||||
"Granule size must be a page-size-aligned power-of-2 value");
|
||||
assert(commit_granule_words() <= chunklevel::MAX_CHUNK_WORD_SIZE, "Too large granule size");
|
||||
assert(is_power_of_2(commit_granule_words()), "granule size must be a power of 2");
|
||||
|
||||
// Off for release builds, off by default - but switchable - for debug builds.
|
||||
DEBUG_ONLY(_use_allocation_guard = MetaspaceGuardAllocations;)
|
||||
|
@ -35,10 +35,10 @@ namespace metaspace {
|
||||
class Settings : public AllStatic {
|
||||
|
||||
// Granularity, in bytes, metaspace is committed with.
|
||||
static size_t _commit_granule_bytes;
|
||||
static constexpr size_t _commit_granule_bytes = 64 * K;
|
||||
|
||||
// Granularity, in words, metaspace is committed with.
|
||||
static size_t _commit_granule_words;
|
||||
static constexpr size_t _commit_granule_words = _commit_granule_bytes / BytesPerWord;
|
||||
|
||||
// The default size of a VirtualSpaceNode, unless created with an explicitly specified size.
|
||||
// Must be a multiple of the root chunk size.
|
||||
|
@ -523,6 +523,7 @@ static SpecialFlag const special_jvm_flags[] = {
|
||||
{ "G1UsePreventiveGC", JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::jdk(22) },
|
||||
{ "G1ConcRSLogCacheSize", JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() },
|
||||
{ "G1ConcRSHotCardLimit", JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() },
|
||||
{ "MetaspaceReclaimPolicy", JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() },
|
||||
|
||||
#ifdef ASSERT
|
||||
{ "DummyObsoleteTestFlag", JDK_Version::undefined(), JDK_Version::jdk(18), JDK_Version::undefined() },
|
||||
|
@ -1422,9 +1422,6 @@ const int ObjectAlignmentInBytes = 8;
|
||||
"Force the class space to be allocated at this address or " \
|
||||
"fails VM initialization (requires -Xshare=off.") \
|
||||
\
|
||||
product(ccstr, MetaspaceReclaimPolicy, "balanced", DIAGNOSTIC, \
|
||||
"options: balanced, aggressive") \
|
||||
\
|
||||
product(bool, PrintMetaspaceStatisticsAtExit, false, DIAGNOSTIC, \
|
||||
"Print metaspace statistics upon VM exit.") \
|
||||
\
|
||||
|
@ -40,34 +40,6 @@
|
||||
* @run main/native GTestWrapper --gtest_filter=metaspace* -XX:+UnlockDiagnosticVMOptions -XX:VerifyMetaspaceInterval=3
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/* @test id=reclaim-aggressive-debug
|
||||
* @bug 8251158
|
||||
* @summary Run metaspace-related gtests for reclaim policy aggressive (with verifications)
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.xml
|
||||
* @requires vm.debug
|
||||
* @requires vm.flagless
|
||||
* @run main/native GTestWrapper --gtest_filter=metaspace* -XX:+UnlockDiagnosticVMOptions -XX:MetaspaceReclaimPolicy=aggressive -XX:VerifyMetaspaceInterval=3
|
||||
*/
|
||||
|
||||
/* @test id=reclaim-aggressive-ndebug
|
||||
* @bug 8251158
|
||||
* @summary Run metaspace-related gtests for reclaim policy aggressive
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.xml
|
||||
* @requires vm.debug == false
|
||||
* @requires vm.flagless
|
||||
* @run main/native GTestWrapper --gtest_filter=metaspace* -XX:+UnlockDiagnosticVMOptions -XX:MetaspaceReclaimPolicy=aggressive
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/* @test id=balanced-with-guards
|
||||
* @summary Run metaspace-related gtests with allocation guards enabled
|
||||
* @library /test/lib
|
||||
@ -78,9 +50,6 @@
|
||||
* @run main/native GTestWrapper --gtest_filter=metaspace* -XX:VerifyMetaspaceInterval=3 -XX:+MetaspaceGuardAllocations
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/* @test id=balanced-no-ccs
|
||||
* @summary Run metaspace-related gtests with compressed class pointers off
|
||||
* @library /test/lib
|
||||
@ -88,5 +57,5 @@
|
||||
* java.xml
|
||||
* @requires vm.bits == 64
|
||||
* @requires vm.flagless
|
||||
* @run main/native GTestWrapper --gtest_filter=metaspace* -XX:+UnlockDiagnosticVMOptions -XX:MetaspaceReclaimPolicy=balanced -XX:-UseCompressedClassPointers
|
||||
* @run main/native GTestWrapper --gtest_filter=metaspace* -XX:+UnlockDiagnosticVMOptions -XX:-UseCompressedClassPointers
|
||||
*/
|
||||
|
@ -36,16 +36,6 @@ import jdk.test.lib.JDKToolFinder;
|
||||
* @run main/othervm -Dwith-compressed-class-space -XX:MaxMetaspaceSize=201M -Xmx100M -XX:+UseCompressedOops -XX:+UseCompressedClassPointers PrintMetaspaceDcmd
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=test-64bit-ccs-aggressivereclaim
|
||||
* @summary Test the VM.metaspace command
|
||||
* @requires vm.bits == "64"
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @run main/othervm -Dwith-compressed-class-space -XX:MaxMetaspaceSize=201M -Xmx100M -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UnlockDiagnosticVMOptions -XX:MetaspaceReclaimPolicy=aggressive PrintMetaspaceDcmd
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=test-64bit-ccs-guarded
|
||||
* @summary Test the VM.metaspace command
|
||||
|
@ -93,7 +93,7 @@ public class MetaspaceTestManyArenasManyThreads extends MetaspaceTestWithThreads
|
||||
// frees their metaspace arenas. All within CLDG::purge(). But since this test isolates the metaspace
|
||||
// context and does test it separately, GC and CLDG are not involved here. We need to purge manually.
|
||||
//
|
||||
// Purging uncommits all free chunks >= 64K/16K (MetaspaceReclaimPolicy=standard/aggressive).
|
||||
// Purging uncommits all free chunks >= 64K
|
||||
context.purge();
|
||||
|
||||
context.updateTotals();
|
||||
|
@ -77,10 +77,8 @@ public class MetaspaceTestWithThreads {
|
||||
|
||||
context.checkStatistics();
|
||||
|
||||
if (Settings.settings().doesReclaim()) {
|
||||
if (context.committedWords() > 0) {
|
||||
throw new RuntimeException("Expected no committed words after purging empty metaspace context (was: " + context.committedWords() + ")");
|
||||
}
|
||||
if (context.committedWords() > 0) {
|
||||
throw new RuntimeException("Expected no committed words after purging empty metaspace context (was: " + context.committedWords() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,13 +27,8 @@ import jdk.test.whitebox.WhiteBox;
|
||||
|
||||
public final class Settings {
|
||||
|
||||
public String reclaimPolicy = WhiteBox.getWhiteBox().getStringVMFlag("MetaspaceReclaimPolicy");
|
||||
public boolean usesAllocationGuards = WhiteBox.getWhiteBox().getBooleanVMFlag("MetaspaceGuardAllocations");
|
||||
|
||||
final public boolean doesReclaim() {
|
||||
return reclaimPolicy.equals("balanced") || reclaimPolicy.equals("aggessive");
|
||||
}
|
||||
|
||||
final static long rootChunkWordSize = 2048 * 1024;
|
||||
|
||||
static Settings theSettings;
|
||||
|
@ -35,7 +35,6 @@
|
||||
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
|
||||
*
|
||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:VerifyMetaspaceInterval=10 TestMetaspaceAllocation
|
||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:VerifyMetaspaceInterval=10 -XX:MetaspaceReclaimPolicy=aggressive TestMetaspaceAllocation
|
||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:VerifyMetaspaceInterval=10 -XX:+MetaspaceGuardAllocations TestMetaspaceAllocation
|
||||
*
|
||||
*/
|
||||
@ -52,7 +51,6 @@
|
||||
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
|
||||
*
|
||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestMetaspaceAllocation
|
||||
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:MetaspaceReclaimPolicy=aggressive TestMetaspaceAllocation
|
||||
*/
|
||||
|
||||
public class TestMetaspaceAllocation {
|
||||
|
@ -57,24 +57,6 @@
|
||||
* TestMetaspaceAllocationMT1
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=debug-aggressive
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @build jdk.test.whitebox.WhiteBox
|
||||
* @key randomness
|
||||
* @requires (vm.debug == true)
|
||||
*
|
||||
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
|
||||
*
|
||||
* @run main/othervm/timeout=400
|
||||
* -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* -XX:VerifyMetaspaceInterval=10
|
||||
* -XX:MetaspaceReclaimPolicy=aggressive
|
||||
* TestMetaspaceAllocationMT1
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=debug-guard
|
||||
* @library /test/lib
|
||||
@ -109,23 +91,6 @@
|
||||
* TestMetaspaceAllocationMT1
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=ndebug-aggressive
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @build jdk.test.whitebox.WhiteBox
|
||||
* @key randomness
|
||||
* @requires (vm.debug == false)
|
||||
*
|
||||
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
|
||||
*
|
||||
* @run main/othervm/timeout=400
|
||||
* -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* -XX:MetaspaceReclaimPolicy=aggressive
|
||||
* TestMetaspaceAllocationMT1
|
||||
*/
|
||||
|
||||
public class TestMetaspaceAllocationMT1 {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
@ -57,24 +57,6 @@
|
||||
* TestMetaspaceAllocationMT2
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=debug-aggressive
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @build jdk.test.whitebox.WhiteBox
|
||||
* @key randomness
|
||||
* @requires (vm.debug == true)
|
||||
*
|
||||
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
|
||||
*
|
||||
* @run main/othervm/timeout=400
|
||||
* -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* -XX:VerifyMetaspaceInterval=10
|
||||
* -XX:MetaspaceReclaimPolicy=aggressive
|
||||
* TestMetaspaceAllocationMT2
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=debug-guard
|
||||
* @library /test/lib
|
||||
@ -109,23 +91,6 @@
|
||||
* TestMetaspaceAllocationMT2
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test id=ndebug-aggressive
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @build jdk.test.whitebox.WhiteBox
|
||||
* @key randomness
|
||||
* @requires (vm.debug == false)
|
||||
*
|
||||
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
|
||||
*
|
||||
* @run main/othervm/timeout=400
|
||||
* -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* -XX:MetaspaceReclaimPolicy=aggressive
|
||||
* TestMetaspaceAllocationMT2
|
||||
*/
|
||||
|
||||
public class TestMetaspaceAllocationMT2 {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
Loading…
x
Reference in New Issue
Block a user