RFR: 8232722: G1 archive region deallocation may shrink the heap below -Xms

Albert Mingkun Yang ayang at openjdk.org
Wed May 31 10:21:00 UTC 2023


On Wed, 31 May 2023 07:05:32 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 558:
>> 
>>> 556:   // Then note how much new space we have allocated.
>>> 557:   regions_committed = 0;
>>> 558:   uint regions_allocated = 0;
>> 
>> Why is alloc-count required? Isn't it sth like `ceil(range/region_size)`?
>
> This adds implicit assumptions about how the range looks like, i.e. the start address; I think it is nicer if the one allocating the memory returns this value like any other information about the allocation.

I think the closure below, `set_region_to_old`, already assumes the start-addr is region-start. In fact, I believe that is an implicit assumption shared by `alloc_archive_regions`, `dealloc_archive_regions`, and `populate_archive_regions_bot_part`.

I'd prefer making it explicit, but YMMV.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14145#discussion_r1211474701


More information about the hotspot-gc-dev mailing list