On Fri, 26 May 2023 16:35:32 GMT, Paul Hohensee <p...@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

Reply via email to