Skip to content

Commit

Permalink
Not to use MADV_POPULATE_WRITE on the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
limingliu-ampere committed Jun 11, 2024
1 parent a1136b8 commit 6c4ea51
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> args = new ArrayList<>();
Collections.addAll(args,
"-XX:+UnlockDiagnosticVMOptions",
"-Xmx100M",
"-XX:+AlwaysPreTouchStacks",
"-XX:NativeMemoryTracking=summary", "-XX:+PrintNMTStatistics",
"TestAlwaysPreTouchStacks",
"test");
"-XX:NativeMemoryTracking=summary", "-XX:+PrintNMTStatistics");
if (System.getProperty("os.name").contains("Linux")) {
args.add("-XX:-UseMadvPopulateWrite");
}
Collections.addAll(args, "TestAlwaysPreTouchStacks", "test");
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.reportDiagnosticSummary();

Expand Down

0 comments on commit 6c4ea51

Please sign in to comment.