Skip to content

Commit bba16f6

Browse files
author
Thomas Schatzl
committedApr 15, 2021
8264818: G1: Improve liveness check for empty pinned regions after full gc marking
Reviewed-by: sjohanss, ayang, mli
1 parent 75da1e9 commit bba16f6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -54,18 +54,18 @@ bool G1FullGCPrepareTask::G1CalculatePointersClosure::do_heap_region(HeapRegion*
5454
free_humongous_region(hr);
5555
}
5656
} else if (hr->is_open_archive()) {
57-
bool is_empty = _bitmap->get_next_marked_addr(hr->bottom(), hr->top()) >= hr->top();
57+
bool is_empty = _collector->live_words(hr->hrm_index()) == 0;
5858
if (is_empty) {
5959
free_open_archive_region(hr);
6060
}
6161
} else if (hr->is_closed_archive()) {
6262
// nothing to do with closed archive region
6363
} else {
6464
assert(MarkSweepDeadRatio > 0,
65-
"it should not trigger skipping compaction, when MarkSweepDeadRatio == 0");
65+
"only skip compaction for other regions when MarkSweepDeadRatio > 0");
6666

67-
// Force the high live ration region pinned,
68-
// as we need skip these regions in the later compact step.
67+
// Force the high live ratio region as compacting to skip these regions in the
68+
// later compaction step.
6969
force_not_compacted = true;
7070
log_debug(gc, phases)("Phase 2: skip compaction region index: %u, live words: " SIZE_FORMAT,
7171
hr->hrm_index(), _collector->live_words(hr->hrm_index()));

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Apr 15, 2021

@openjdk-notifier[bot]
Please sign in to comment.