mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
7125281: G1: heap expansion code is replicated
Reviewed-by: brutisso, johnc
This commit is contained in:
parent
90cdae9775
commit
30bfc8f549
1 changed files with 2 additions and 15 deletions
|
@ -3793,6 +3793,8 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
|
||||||
size_t expand_bytes = g1_policy()->expansion_amount();
|
size_t expand_bytes = g1_policy()->expansion_amount();
|
||||||
if (expand_bytes > 0) {
|
if (expand_bytes > 0) {
|
||||||
size_t bytes_before = capacity();
|
size_t bytes_before = capacity();
|
||||||
|
// No need for an ergo verbose message here,
|
||||||
|
// expansion_amount() does this when it returns a value > 0.
|
||||||
if (!expand(expand_bytes)) {
|
if (!expand(expand_bytes)) {
|
||||||
// We failed to expand the heap so let's verify that
|
// We failed to expand the heap so let's verify that
|
||||||
// committed/uncommitted amount match the backing store
|
// committed/uncommitted amount match the backing store
|
||||||
|
@ -3849,21 +3851,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
|
||||||
// CM reference discovery will be re-enabled if necessary.
|
// CM reference discovery will be re-enabled if necessary.
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
size_t expand_bytes = g1_policy()->expansion_amount();
|
|
||||||
if (expand_bytes > 0) {
|
|
||||||
size_t bytes_before = capacity();
|
|
||||||
// No need for an ergo verbose message here,
|
|
||||||
// expansion_amount() does this when it returns a value > 0.
|
|
||||||
if (!expand(expand_bytes)) {
|
|
||||||
// We failed to expand the heap so let's verify that
|
|
||||||
// committed/uncommitted amount match the backing store
|
|
||||||
assert(capacity() == _g1_storage.committed_size(), "committed size mismatch");
|
|
||||||
assert(max_capacity() == _g1_storage.reserved_size(), "reserved size mismatch");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// We should do this after we potentially expand the heap so
|
// We should do this after we potentially expand the heap so
|
||||||
// that all the COMMIT events are generated before the end GC
|
// that all the COMMIT events are generated before the end GC
|
||||||
// event, and after we retire the GC alloc regions so that all
|
// event, and after we retire the GC alloc regions so that all
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue