RFR: 8303252: G1: Return early from Full-GC if no regions are selected for compaction.
Thomas Schatzl
tschatzl at openjdk.org
Tue Feb 28 10:40:04 UTC 2023
On Mon, 27 Feb 2023 15:21:00 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:
> Please review this change to return early from full-gc in case no regions have been selected as targets for compaction.
> To skip `phase3_adjust_pointers` and `phase4_do_compaction()`, we need to decouple cleanup work that was piggybacked onto these phases. Thus, the `phase5_` is introduced to do the cleanup.
>
> Testing: Tier 1-3.
Changes requested by tschatzl (Reviewer).
src/hotspot/share/gc/g1/g1FullCollector.cpp line 334:
> 332:
> 333: if (!has_compaction_targets()) {
> 334: return;
Maybe it is useful to add a log message here that no compaction targets were found before exiting. Something like:
log_debug(gc, phases) debug("Phase 2: No compaction targetes");
So that people looking at logs have a better understanding why the other phases are skipped and the next log message will be about phase 5.
-------------
PR: https://git.openjdk.org/jdk/pull/12768
More information about the hotspot-gc-dev
mailing list