From af9d11eb223a1b8144fdd03c52611525e62c5da8 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Tue, 29 Aug 2023 10:03:54 +0000 Subject: [PATCH] 8314139: TEST_BUG: runtime/os/THPsInThreadStackPreventionTest.java could fail on machine with large number of cores Backport-of: 733250288325bc663afc0376342d4c5a7a471cbd --- .../jtreg/runtime/os/THPsInThreadStackPreventionTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java b/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java index f16c5d66311..4b76468bb74 100644 --- a/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java +++ b/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java @@ -165,6 +165,9 @@ public static void main(String[] args) throws Exception { "-Xmx" + heapSizeMB + "m", "-Xms" + heapSizeMB + "m", "-XX:+AlwaysPreTouch", // stabilize RSS "-Xss" + threadStackSizeMB + "m", "-XX:-CreateCoredumpOnCrash", + // Limits the number of JVM-internal threads, which depends on the available cores of the + // machine. RSS+Swap could exceed acceptableRSSLimitMB when JVM creates many internal threads. + "-XX:ActiveProcessorCount=2", // This will delay the child threads before they create guard pages, thereby greatly increasing the // chance of large VMA formation + hugepage coalescation; see JDK-8312182 "-XX:+DelayThreadStartALot"