RFR: JDK-8298298: NMT: count deltas are printed with 32-bit signed size
Thomas Stuefe
stuefe at openjdk.org
Wed Dec 7 17:57:37 UTC 2022
On Wed, 7 Dec 2022 17:10:18 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> Deltas for counts in NMT differential reports are shown as signed int, restricting them to +-2g. So on large 64-bit machines they can conceivably overflow. These counts are number of malloc blocks, or number of classes, or threads.
>
> Patch changes delta printing from int to ssize_t.
>
> Note that I don't worry about overflowing SSIZE_MIN|MAX here. These are counts of existing things (malloc blocks, classes etc) and we just cannot have that many things. Same is true for 32-bit, where ssize_t is int: can never overflow for any of the used counters, and if it does, its an accounting error.
>
> Note we have the same problem with diff sizes. I expect [8281213](https://bugs.openjdk.org/browse/JDK-8281213) to fix that.
Tested: fastdebug and release for 32-bit/64-bit, runtime/NMT and NMT gtests
-------------
PR: https://git.openjdk.org/jdk/pull/11568
More information about the hotspot-dev
mailing list