[jdk8u-dev] RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM
Paul Hohensee
phh at openjdk.org
Sun Nov 26 19:59:33 UTC 2023
I'd like to backport the definition and implementation of com.sun.management.ThreadMXBean.getTotalThreadAllocatedBytes to 8u. The backport CSR is [JDK-8320375](https://bugs.openjdk.org/browse/JDK-8320375). A follow-up bugfix backport of [JDK-8313081](https://bugs.openjdk.org/browse/JDK-8313081) will be done following this backport. The combined backports have been in production at Amazon for two months with no issues. The backport uses the reserved6 slot in jmm.h in order to preserve binary compatibility with 11u. Per current policy, there is no update to JMM_VERSION in jmm.h and the new method is marked
@since 8u412
Aside from file relocation and context differences, relative to the 11u backport the MonitoringSupport_lock definition macro changes, and the reserved1 rather than reserved6 jmm slot is used. SMR doesn't exist in 8u, so jmm_GetTotalThreadAllocated bytes attempts to lock Threads_lock instead, and if the Threads_lock is already locked, the previous return value is returned. HotSpotThreadImpl.java doesn't exist in 8u, so the hunk associated with it is dropped.
-------------
Commit messages:
- 8304074: make @since 8u412
- Merge branch 'master' into backport-8304074
- Merge branch 'master' into backport-8304074
- Backport 3eced01f9efe2567a07b63343f8559683a2d0517
Changes: https://git.openjdk.org/jdk8u-dev/pull/392/files
Webrev: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=392&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8304074
Stats: 294 lines in 13 files changed: 212 ins; 45 del; 37 mod
Patch: https://git.openjdk.org/jdk8u-dev/pull/392.diff
Fetch: git fetch https://git.openjdk.org/jdk8u-dev.git pull/392/head:pull/392
PR: https://git.openjdk.org/jdk8u-dev/pull/392
More information about the jdk8u-dev
mailing list