RFR: 8237542: JMapHeapConfigTest.java doesn't work with negative jlong values

Chris Plummer cjplummer at openjdk.org
Mon Aug 21 19:44:52 UTC 2023


The test tries to match up various GC -XX:+PrintFlagsFinal values with the output of jhsdb -jmap --pid <pid> --heap. With ZGC, MaxNewSize set to (size_t)-1, but PrintFlagsFinal prints it as an unsigned long:

    size_t MaxNewSize = 18446744073709551615 {product} {default} 

jmap normally prints out both the raw size and the MB size. For example:

MaxHeapSize              = 805306368 (768.0MB)

But as part of the fix for [JDK-6718125](https://bugs.openjdk.org/browse/JDK-6718125), it stopped printing the raw value for negative values an only printed the MB value. So for MaxNewSize we had:

     MaxNewSize = 17592186044415 MB

Instead of:

    MaxNewSize = 18446744073709551615 (17592186044415 MB)

So the test fails to find 18446744073709551615 in the output. I fixed jmap to include the raw value as an unsigned long, even if negative as a signed long (to be consistent with PrintFlagsFinal output), so now the test passes even when MaxNewSize is included in the list.

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

Commit messages:
 - fix jcheck error
 - Fix printing and testing of negative unsigned long values

Changes: https://git.openjdk.org/jdk/pull/15368/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15368&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8237542
  Stats: 19 lines in 2 files changed: 6 ins; 7 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/15368.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15368/head:pull/15368

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


More information about the hotspot-gc-dev mailing list