mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8372993: Serial: max_eden_size is too small after JDK-8368740
Reviewed-by: ayang, aboldtch, stefank
This commit is contained in:
parent
135661b438
commit
c0636734bd
@ -236,7 +236,10 @@ DefNewGeneration::DefNewGeneration(ReservedSpace rs,
|
||||
// These values are exported as performance counters.
|
||||
uintx size = _virtual_space.reserved_size();
|
||||
_max_survivor_size = compute_survivor_size(size, SpaceAlignment);
|
||||
_max_eden_size = size - (2*_max_survivor_size);
|
||||
|
||||
// Eden might grow to be almost as large as the entire young generation.
|
||||
// We approximate this as the entire virtual space.
|
||||
_max_eden_size = size;
|
||||
|
||||
// allocate the performance counters
|
||||
|
||||
|
||||
@ -286,6 +286,20 @@ public class TestNewSizeFlags {
|
||||
if (YOUNG_GC_TYPE == GCTypes.YoungGCType.G1) {
|
||||
return new MemoryUsage(edenUsageInit + survivorUsageInit, 0,
|
||||
edenUsageCommited + survivorUsageCommited, Long.MAX_VALUE);
|
||||
} else if (YOUNG_GC_TYPE == GCTypes.YoungGCType.DefNew) {
|
||||
// Eden might grow to be almost the entire young generation,
|
||||
// so it is approximated as the size for the entire young
|
||||
// generation.
|
||||
long youngGenUsageMax = edenUsage.getMax();
|
||||
|
||||
long combinedSurvivorUsageMax = 2 * survivorUsage.getMax();
|
||||
if (combinedSurvivorUsageMax > youngGenUsageMax) {
|
||||
throw new RuntimeException("Unexpectedly large survivorUsage combined maximum value: " + combinedSurvivorUsageMax);
|
||||
}
|
||||
|
||||
return new MemoryUsage(edenUsageInit + survivorUsageInit * 2, 0,
|
||||
edenUsageCommited + survivorUsageCommited * 2,
|
||||
youngGenUsageMax);
|
||||
} else {
|
||||
return new MemoryUsage(edenUsageInit + survivorUsageInit * 2, 0,
|
||||
edenUsageCommited + survivorUsageCommited * 2,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user