File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
test/hotspot/jtreg/gc/arguments Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,20 @@ private static MemoryUsage getYoungGenUsage() {
286286 if (YOUNG_GC_TYPE == GCTypes .YoungGCType .G1 ) {
287287 return new MemoryUsage (edenUsageInit + survivorUsageInit , 0 ,
288288 edenUsageCommited + survivorUsageCommited , Long .MAX_VALUE );
289+ } else if (YOUNG_GC_TYPE == GCTypes .YoungGCType .DefNew ) {
290+ // Eden might grow to be almost the entire young generation,
291+ // so it is approximated as the size for the entire young
292+ // generation.
293+ long youngGenUsageMax = edenUsage .getMax ();
294+
295+ long combinedSurvivorUsageMax = 2 * survivorUsage .getMax ();
296+ if (combinedSurvivorUsageMax > youngGenUsageMax ) {
297+ throw new RuntimeException ("Unexpectedly large survivorUsage combined maximum value: " + combinedSurvivorUsageMax );
298+ }
299+
300+ return new MemoryUsage (edenUsageInit + survivorUsageInit * 2 , 0 ,
301+ edenUsageCommited + survivorUsageCommited * 2 ,
302+ youngGenUsageMax );
289303 } else {
290304 return new MemoryUsage (edenUsageInit + survivorUsageInit * 2 , 0 ,
291305 edenUsageCommited + survivorUsageCommited * 2 ,
You can’t perform that action at this time.
0 commit comments