mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-14 18:03:44 +00:00
8347126: gc/stress/TestStressG1Uncommit.java gets OOM-killed
Reviewed-by: tschatzl, gli
This commit is contained in:
parent
82e16ba248
commit
dff5719e6f
@ -57,6 +57,7 @@ public class TestStressG1Uncommit {
|
||||
Collections.addAll(options,
|
||||
"-Xlog:gc,gc+heap+region=debug",
|
||||
"-XX:+UseG1GC",
|
||||
"-Xmx1g",
|
||||
StressUncommit.class.getName()
|
||||
);
|
||||
OutputAnalyzer output = ProcessTools.executeLimitedTestJava(options);
|
||||
@ -79,9 +80,9 @@ class StressUncommit {
|
||||
// Leave 20% head room to try to avoid Full GCs.
|
||||
long allocationSize = (long) (Runtime.getRuntime().maxMemory() * 0.8);
|
||||
|
||||
// Figure out suitable number of workers (~1 per gig).
|
||||
int gigsOfAllocation = (int) Math.ceil((double) allocationSize / G);
|
||||
int numWorkers = Math.min(gigsOfAllocation, Runtime.getRuntime().availableProcessors());
|
||||
// Figure out suitable number of workers (~1 per 100M).
|
||||
int allocationChunks = (int) Math.ceil((double) allocationSize / (100 * M));
|
||||
int numWorkers = Math.min(allocationChunks, Runtime.getRuntime().availableProcessors());
|
||||
long workerAllocation = allocationSize / numWorkers;
|
||||
|
||||
log("Using " + numWorkers + " workers, each allocating: ~" + (workerAllocation / M) + "M");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user