Skip to content

Commit 1315bbb

Browse files
Satyen SubramaniamVictor Rudometov
authored andcommitted
8347126: gc/stress/TestStressG1Uncommit.java gets OOM-killed
Backport-of: dff5719e6f95f9ce50a5d49adf13541e22f7b5b1
1 parent 76ef728 commit 1315bbb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/hotspot/jtreg/gc/stress/TestStressG1Uncommit.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public static void main(String[] args) throws Exception {
5757
Collections.addAll(options,
5858
"-Xlog:gc,gc+heap+region=debug",
5959
"-XX:+UseG1GC",
60+
"-Xmx1g",
6061
StressUncommit.class.getName()
6162
);
6263
OutputAnalyzer output = ProcessTools.executeLimitedTestJava(options);
@@ -79,9 +80,9 @@ public static void main(String args[]) throws InterruptedException {
7980
// Leave 20% head room to try to avoid Full GCs.
8081
long allocationSize = (long) (Runtime.getRuntime().maxMemory() * 0.8);
8182

82-
// Figure out suitable number of workers (~1 per gig).
83-
int gigsOfAllocation = (int) Math.ceil((double) allocationSize / G);
84-
int numWorkers = Math.min(gigsOfAllocation, Runtime.getRuntime().availableProcessors());
83+
// Figure out suitable number of workers (~1 per 100M).
84+
int allocationChunks = (int) Math.ceil((double) allocationSize / (100 * M));
85+
int numWorkers = Math.min(allocationChunks, Runtime.getRuntime().availableProcessors());
8586
long workerAllocation = allocationSize / numWorkers;
8687

8788
log("Using " + numWorkers + " workers, each allocating: ~" + (workerAllocation / M) + "M");

0 commit comments

Comments
 (0)