jmx-dev RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v23]
Volker Simonis
simonis at openjdk.org
Tue May 30 14:23:19 UTC 2023
On Fri, 26 May 2023 16:35:32 GMT, Paul Hohensee <phh at openjdk.org> wrote:
>> The tests and all apps might thank us for keeping last known value, and not returning anything lower, ensuring montonicity.
>
> Fixed using a high water mark.
A simple fix for guaranteeing monotonicity, would be to add another field (e.g. `max_allocated_bytes`) which keeps the last result returned by `getTotalThreadAllocatedBytes()` and the latter would then return the maximum of the current computation and `max_allocated_bytes`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13814#discussion_r1210355727
More information about the jmx-dev
mailing list