JDK-8344603 : NMT: JDK-8333994 detailed mode output changes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-11-20
  • Updated: 2024-11-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
JDK-8333994 added source info to NMTs call stack printing. However it also changed the behavior of `NativeCallStack::print_on(outputStream* out)` in such a way that it no longer emits a newline between each frame. Unclear if this was intentional, but it makes the output a lot harder to parse. In the report this only affects the printing of the regions which are partially committed (or have multiple different commit call stacks), as the reservation call stacks is printed using the `NativeCallStackPrinter` which will emit the newlines. It is also unclear why `NativeCallStackPrinter` is not also used for the committed call stack printing so it can benefit from the cache. But there are more places than the report which make use of `NativeCallStack::print_on`.

Current output:
```
[0x00007f96cc53c000 - 0x00007f96cc63c000] reserved and committed 1048576 for GC from
    [0x00007f96cef944ac]ZPageTable::ZPageTable(ZPageAllocator*)+0x6c   (allocation.inline.hpp:78)
    [0x00007f96cef6db04]ZHeap::ZHeap()+0x64   (zHeap.cpp:61)
    [0x00007f96cef61c10]ZCollectedHeap::ZCollectedHeap()+0x40   (allocation.hpp:127)
    [0x00007f96cef4e2b5]ZArguments::create_heap()+0x25   (zArguments.cpp:237)

        [0x00007f96cc53c000 - 0x00007f96cc63c000] committed 1048576 from
            [0x00007f96cef944c8]ZPageTable::ZPageTable(ZPageAllocator*)+0x88   (zGranuleMap.inline.hpp:40)[0x00007f96cef6db04]ZHeap::ZHeap()+0x64   (zHeap.cpp:61)[0x00007f96cef61c10]ZCollectedHeap::ZCollectedHeap()+0x40   (allocation.hpp:127)[0x00007f96cef4e2b5]ZArguments::create_heap()+0x25   (zArguments.cpp:237)
```

Expected output:
```
[0x00007f2fa17dd000 - 0x00007f2fa18dd000] reserved and committed 1048576 for GC from
    [0x00007f2fa42354ac]ZPageTable::ZPageTable(ZPageAllocator*)+0x6c   (allocation.inline.hpp:78)
    [0x00007f2fa420eb04]ZHeap::ZHeap()+0x64   (zHeap.cpp:61)
    [0x00007f2fa4202c10]ZCollectedHeap::ZCollectedHeap()+0x40   (allocation.hpp:127)
    [0x00007f2fa41ef2b5]ZArguments::create_heap()+0x25   (zArguments.cpp:237)

        [0x00007f2fa17dd000 - 0x00007f2fa18dd000] committed 1048576 from
            [0x00007f2fa42354c8]ZPageTable::ZPageTable(ZPageAllocator*)+0x88   (zGranuleMap.inline.hpp:40)
            [0x00007f2fa420eb04]ZHeap::ZHeap()+0x64   (zHeap.cpp:61)
            [0x00007f2fa4202c10]ZCollectedHeap::ZCollectedHeap()+0x40   (allocation.hpp:127)
            [0x00007f2fa41ef2b5]ZArguments::create_heap()+0x25   (zArguments.cpp:237)
```

Output before JDK-8333994:
```
[0x00007fc14244a000 - 0x00007fc14254a000] reserved and committed 1048576 for GC from
    [0x00007fc144ea1f8c]ZPageTable::ZPageTable(ZPageAllocator*)+0x6c
    [0x00007fc144e7b5e4]ZHeap::ZHeap()+0x64
    [0x00007fc144e6f6f0]ZCollectedHeap::ZCollectedHeap()+0x40
    [0x00007fc144e5bd95]ZArguments::create_heap()+0x25

        [0x00007fc14244a000 - 0x00007fc14254a000] committed 1048576 from
            [0x00007fc144ea1fa8]ZPageTable::ZPageTable(ZPageAllocator*)+0x88
            [0x00007fc144e7b5e4]ZHeap::ZHeap()+0x64
            [0x00007fc144e6f6f0]ZCollectedHeap::ZCollectedHeap()+0x40
            [0x00007fc144e5bd95]ZArguments::create_heap()+0x25
```