RFR: 8271217: Fix race between G1PeriodicGCTask checks and GC request

Kim Barrett kbarrett at openjdk.java.net
Wed Aug 4 14:51:29 UTC 2021


On Wed, 4 Aug 2021 09:08:30 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:

> If you like, you could initialize the values of the counters in the default constructor (to zero for example).

I think initialized to zero is no better than uninitialized here. Either
way, a default-constructed object of this type shouldn't be given to
try_collect. In an unpublished development version I had a debug-only
is_initialized flag that was set appropriately by the constructors and
checked by the accessors, but decided it more clutter than it was worth and
dropped it.

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

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



More information about the hotspot-gc-dev mailing list