RFR: 8285710: miscalculation of G1CardSetAllocator wasted memory size [v2]

Albert Mingkun Yang ayang at openjdk.java.net
Fri May 6 09:01:50 UTC 2022


On Fri, 6 May 2022 08:30:31 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.

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

PR: https://git.openjdk.java.net/jdk/pull/8424



More information about the hotspot-gc-dev mailing list