Skip to content

Commit

Permalink
8324781: runtime/Thread/TestAlwaysPreTouchStacks.java failed with Exp…
Browse files Browse the repository at this point in the history
…ected a higher ratio between stack committed and reserved 8325218: gc/parallel/TestAlwaysPreTouchBehavior.java fails

Reviewed-by: stefank, jsjolen, stuefe
  • Loading branch information
limingliu-ampere committed Jul 5, 2024
1 parent 34b4966 commit 4b4446e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @requires os.family == "linux"
* @requires os.maxMemory > 2G
* @library /test/lib
* @run main/othervm -Xmx1g -Xms1g -XX:+UseParallelGC -XX:+AlwaysPreTouch gc.parallel.TestAlwaysPreTouchBehavior
* @run main/othervm -Xmx1g -Xms1g -XX:+UseParallelGC -XX:+AlwaysPreTouch -XX:+UnlockDiagnosticVMOptions -XX:-UseMadvPopulateWrite gc.parallel.TestAlwaysPreTouchBehavior
*/
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
Expand Down Expand Up @@ -77,4 +77,3 @@ public static void main(String [] args) {
Asserts.assertGreaterThanOrEqual(rss, committedMemory, "RSS of this process(" + rss + "kb) should be bigger than or equal to committed heap mem(" + committedMemory + "kb)");
}
}

14 changes: 9 additions & 5 deletions test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.concurrent.CyclicBarrier;
Expand Down Expand Up @@ -89,14 +90,17 @@ public static void main(String[] args) throws Exception {
// should show up with fully - or almost fully - committed thread stacks.

} else {

ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
ArrayList<String> vmArgs = new ArrayList<>();
Collections.addAll(vmArgs,
"-XX:+UnlockDiagnosticVMOptions",
"-Xmx100M",
"-XX:+AlwaysPreTouchStacks",
"-XX:NativeMemoryTracking=summary", "-XX:+PrintNMTStatistics",
"TestAlwaysPreTouchStacks",
"test");
"-XX:NativeMemoryTracking=summary", "-XX:+PrintNMTStatistics");
if (System.getProperty("os.name").contains("Linux")) {
vmArgs.add("-XX:-UseMadvPopulateWrite");
}
Collections.addAll(vmArgs, "TestAlwaysPreTouchStacks", "test");
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(vmArgs);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.reportDiagnosticSummary();

Expand Down

0 comments on commit 4b4446e

Please sign in to comment.