diff --git a/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp b/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp index ebeb1a8f643bd..2ccc4ebc09eec 100644 --- a/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp +++ b/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp @@ -194,7 +194,7 @@ class ChunkManagerRandomChunkAllocTest { IntRange rand(100); - for (int j = 0; j < 1000; j++) { + for (int j = 0; j < 750; j++) { bool force_alloc = false; bool force_free = true; @@ -249,7 +249,7 @@ class ChunkManagerRandomChunkAllocTest { // {} void do_tests() { - const int num_runs = 5; + const int num_runs = 3; for (int n = 0; n < num_runs; n++) { one_test(); } diff --git a/test/hotspot/gtest/metaspace/test_freeblocks.cpp b/test/hotspot/gtest/metaspace/test_freeblocks.cpp index 1ad14d7fc2250..6ca5fb8b05fc4 100644 --- a/test/hotspot/gtest/metaspace/test_freeblocks.cpp +++ b/test/hotspot/gtest/metaspace/test_freeblocks.cpp @@ -130,7 +130,7 @@ class FreeBlocksTest { bool forcefeed = false; bool draining = false; bool stop = false; - int iter = 100000; // safety stop + int iter = 25000; // safety stop while (!stop && iter > 0) { iter --; int surprise = (int)os::random() % 10; diff --git a/test/hotspot/gtest/metaspace/test_metaspacearena_stress.cpp b/test/hotspot/gtest/metaspace/test_metaspacearena_stress.cpp index f9500ed8ce1bf..2d0dc665f9aae 100644 --- a/test/hotspot/gtest/metaspace/test_metaspacearena_stress.cpp +++ b/test/hotspot/gtest/metaspace/test_metaspacearena_stress.cpp @@ -380,7 +380,7 @@ class MetaspaceArenaTest { // - (rarely) deallocate (simulates metaspace deallocation, e.g. class redefinitions) // - delete a test bed (simulates collection of a loader and subsequent return of metaspace to freelists) - const int iterations = 10000; + const int iterations = 2500; // Lets have a ceiling on number of words allocated (this is independent from the commit limit) const size_t max_allocation_size = 8 * M; diff --git a/test/hotspot/gtest/metaspace/test_virtualspacenode.cpp b/test/hotspot/gtest/metaspace/test_virtualspacenode.cpp index daadee7333104..74e0aaa61240a 100644 --- a/test/hotspot/gtest/metaspace/test_virtualspacenode.cpp +++ b/test/hotspot/gtest/metaspace/test_virtualspacenode.cpp @@ -355,7 +355,7 @@ class VirtualSpaceNodeTest { TestMap testmap(c->word_size()); assert(testmap.get_num_set() == 0, "Sanity"); - for (int run = 0; run < 1000; run++) { + for (int run = 0; run < 750; run++) { const size_t committed_words_before = testmap.get_num_set(); ASSERT_EQ(_commit_limiter.committed_words(), committed_words_before); @@ -425,7 +425,7 @@ class VirtualSpaceNodeTest { assert(_commit_limit >= _vs_word_size, "No commit limit here pls"); - // Allocate a root chunk and commit a random part of it. Then repeatedly split + // Allocate a root chunk and commit a part of it. Then repeatedly split // it and merge it back together; observe the committed regions of the split chunks. Metachunk* c = alloc_root_chunk(); @@ -562,15 +562,10 @@ TEST_VM(metaspace, virtual_space_node_test_2) { } TEST_VM(metaspace, virtual_space_node_test_3) { - double d = os::elapsedTime(); // Test committing uncommitting arbitrary ranges - for (int run = 0; run < 100; run++) { - VirtualSpaceNodeTest test(metaspace::chunklevel::MAX_CHUNK_WORD_SIZE, - metaspace::chunklevel::MAX_CHUNK_WORD_SIZE); - test.test_split_and_merge_chunks(); - } - double d2 = os::elapsedTime(); - LOG("%f", (d2-d)); + VirtualSpaceNodeTest test(metaspace::chunklevel::MAX_CHUNK_WORD_SIZE, + metaspace::chunklevel::MAX_CHUNK_WORD_SIZE); + test.test_split_and_merge_chunks(); } TEST_VM(metaspace, virtual_space_node_test_4) { diff --git a/test/hotspot/jtreg/runtime/Metaspace/elastic/TestMetaspaceAllocationMT1.java b/test/hotspot/jtreg/runtime/Metaspace/elastic/TestMetaspaceAllocationMT1.java index 22cc4f6b22db3..8bbab2c71e96a 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/elastic/TestMetaspaceAllocationMT1.java +++ b/test/hotspot/jtreg/runtime/Metaspace/elastic/TestMetaspaceAllocationMT1.java @@ -54,7 +54,24 @@ * @run main/othervm/timeout=400 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:VerifyMetaspaceInterval=10 - * TestMetaspaceAllocationMT1 + * TestMetaspaceAllocationMT1 3 + */ + +/* + * @test id=debug-default-strict + * @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/manual + * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:VerifyMetaspaceInterval=10 + * TestMetaspaceAllocationMT1 10 */ /* @@ -72,7 +89,7 @@ * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:VerifyMetaspaceInterval=10 * -XX:+MetaspaceGuardAllocations - * TestMetaspaceAllocationMT1 + * TestMetaspaceAllocationMT1 3 */ /* @@ -88,7 +105,7 @@ * * @run main/othervm/timeout=400 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * TestMetaspaceAllocationMT1 + * TestMetaspaceAllocationMT1 3 */ public class TestMetaspaceAllocationMT1 { @@ -97,7 +114,7 @@ public static void main(String[] args) throws Exception { final long testAllocationCeiling = 1024 * 1024 * 8; // 8m words = 64M on 64bit final int numThreads = 4; - final int seconds = 10; + final int seconds = Integer.parseInt(args[0]); for (int i = 0; i < 3; i ++) { diff --git a/test/hotspot/jtreg/runtime/Metaspace/elastic/TestMetaspaceAllocationMT2.java b/test/hotspot/jtreg/runtime/Metaspace/elastic/TestMetaspaceAllocationMT2.java index a2e9748478dfc..17e3bb99353b2 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/elastic/TestMetaspaceAllocationMT2.java +++ b/test/hotspot/jtreg/runtime/Metaspace/elastic/TestMetaspaceAllocationMT2.java @@ -54,7 +54,24 @@ * @run main/othervm/timeout=400 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:VerifyMetaspaceInterval=10 - * TestMetaspaceAllocationMT2 + * TestMetaspaceAllocationMT2 3 + */ + +/* + * @test id=debug-default-strict + * @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/manual + * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:VerifyMetaspaceInterval=10 + * TestMetaspaceAllocationMT2 10 */ /* @@ -72,7 +89,7 @@ * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:VerifyMetaspaceInterval=10 * -XX:+MetaspaceGuardAllocations - * TestMetaspaceAllocationMT2 + * TestMetaspaceAllocationMT2 3 */ /* @@ -88,7 +105,7 @@ * * @run main/othervm/timeout=400 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * TestMetaspaceAllocationMT2 + * TestMetaspaceAllocationMT2 3 */ public class TestMetaspaceAllocationMT2 { @@ -97,7 +114,7 @@ public static void main(String[] args) throws Exception { final long testAllocationCeiling = 1024 * 1024 * 6; // 8m words = 64M on 64bit final int numThreads = 4; - final int seconds = 10; + final int seconds = Integer.parseInt(args[0]); for (int i = 0; i < 3; i ++) {