RFR: 8313081: MonitoringSupport_lock should be unconditionally initialized after 8304074 [v2]

Paul Hohensee phh at openjdk.org
Wed Jul 26 15:19:02 UTC 2023


> MonitoringSupport_lock is initialized only when UseG1GC is true, but [JDK-8304074](https://bugs.openjdk.org/browse/JDK-8304074) uses it to implement getTotalThreadAllocatedBytes, which is available for all garbage collectors. While the current code sets UseG1GC regardless of which collector is specified, see FLAG_SET_ERGO_IF_DEFAULT(UseG1GC, true) in gcConfig.cpp, if G1 isn't included in the Hotspot build or Hotspot is not running on a server class machine (unlikely these days), the lock will not be initialized. The lock's initialization should be unconditional.
> 
> I updated ThreadAllocatedMemory.java to run the test using both G1 and Serial collectors.

Paul Hohensee has updated the pull request incrementally with one additional commit since the last revision:

  8313081: MonitoringSupport_lock should be unconditionally initialized after 8304074

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/15028/files
  - new: https://git.openjdk.org/jdk/pull/15028/files/e84cb69c..f83eccf7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=15028&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15028&range=00-01

  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/15028.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15028/head:pull/15028

PR: https://git.openjdk.org/jdk/pull/15028


More information about the serviceability-dev mailing list