RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v19]

David Holmes dholmes at openjdk.org
Fri May 19 02:51:56 UTC 2023


On Thu, 18 May 2023 13:56:06 GMT, Paul Hohensee <phh at openjdk.org> wrote:

>> Changed. Not sure atomic load is needed.
>
> Even though this version passed the pre-submit tests, which include the new versions of ThreadAllocatedBytes.java, running it more often on a host with many hardware threads resulted in failures where getTotalAllocatedBytes did not monotonically increase. I believe what happened was that without an acquire/release, the hardware can float earlier stores to _exited_allocated_bytes above later ones. Adding acquire/release fixed the issue.

That should not be possible if the update is always under the lock. acquire/release control what other memory updates you see when you see "this" update - they have no affect on the update itself.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13814#discussion_r1198492860


More information about the serviceability-dev mailing list