RFR: 8285710: miscalculation of G1CardSetAllocator wasted memory size [v3]
tqxia
duke at openjdk.java.net
Sat May 7 02:33:56 UTC 2022
On Fri, 6 May 2022 09:38:01 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>>> is the idea here to include free slots and exclude pending slots when counting unused slots?
>>
>> I think not treating slots on pending lists as unused (or equivalently, treating slots on pending lists as "in-use") is cleaner. Since the free/pending counters are not strictly synchronized (`Atomic::add(&_free_count, count);` in `try_transfer_pending`), adding the pending counter in that formula could cause "unused slots > total slots", which is extremely confusing.
>
> These statistics are calculated during safepoint/gc, so there can be no synchronization issues.
Got it. Thank you both for the explanation.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8424
More information about the hotspot-gc-dev
mailing list