RFR: 8358483: G1: Remove G1HeapRegionManager::num_available_regions
Albert Mingkun Yang
ayang at openjdk.org
Tue Jun 10 18:14:28 UTC 2025
On Tue, 10 Jun 2025 13:14:16 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> Trying to answer the question about the right place for that optimization: To mirror other code like allocate_humongous() which also has the special casing to avoid some expensive operation in G1HeapRegionManager, I would tend to keep the check there, and so my preference would be to keep the code as is. That special-casing does not fit in the suggested location too imo.
On rereading the surrounding code, the early-return logic can even precede the following, right?
// early-return based on obj_regions vs num_available_regions
G1HeapRegion* humongous_start = _hrm.allocate_humongous(obj_regions);
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25611#issuecomment-2960197344
More information about the hotspot-gc-dev
mailing list