RFR: JDK-8298298: NMT: count deltas are printed with 32-bit signed size

Thomas Stuefe stuefe at openjdk.org
Wed Dec 7 17:57:36 UTC 2022


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.

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

Commit messages:
 - JDK-8298298-nmt-count-deltas-32-bit

Changes: https://git.openjdk.org/jdk/pull/11568/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11568&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8298298
  Stats: 15 lines in 3 files changed: 8 ins; 0 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/11568.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11568/head:pull/11568

PR: https://git.openjdk.org/jdk/pull/11568


More information about the hotspot-dev mailing list