Let's start with the reproducer (HelloSpin.java attached):
java -XX:NativeMemoryTracking=detail HelloSpin
<wait 10-15 seconds>
jcmd VM.native_memory baseline
jcmd HelloSpin GC.heap_dump heap.hprof
jcmd VM.native_memory detail.diff
The detail.diff will among other things output an entry for this:
[0x00007f8f6dfc29dd] HeapDumper::dump(char const*)+0x3d
(malloc=8192KB +8192KB, #1 +1)
The entry reflects the buffer allocated in heapDumper.cpp:DumpWriter::DumpWriter(const char* path):
_buffer = (char*)os::malloc(_size, mtInternal);
where size is io_buffer_size = 8MB.
However, the _buffer is *not* leaked - it is free:d up immediately when the heap dumper has done its job, so the information displayed is incorrect.
If I trigger a GC using:
jcmd HelloSpin GC.run
The entry goes away, which I assume means that the information is just not updated in a timely fashion.
This is on Linux/x64. I can reproduce the same problem on both 7u40 and 8.
ILW=MMM=P3
java -XX:NativeMemoryTracking=detail HelloSpin
<wait 10-15 seconds>
jcmd VM.native_memory baseline
jcmd HelloSpin GC.heap_dump heap.hprof
jcmd VM.native_memory detail.diff
The detail.diff will among other things output an entry for this:
[0x00007f8f6dfc29dd] HeapDumper::dump(char const*)+0x3d
(malloc=8192KB +8192KB, #1 +1)
The entry reflects the buffer allocated in heapDumper.cpp:DumpWriter::DumpWriter(const char* path):
_buffer = (char*)os::malloc(_size, mtInternal);
where size is io_buffer_size = 8MB.
However, the _buffer is *not* leaked - it is free:d up immediately when the heap dumper has done its job, so the information displayed is incorrect.
If I trigger a GC using:
jcmd HelloSpin GC.run
The entry goes away, which I assume means that the information is just not updated in a timely fashion.
This is on Linux/x64. I can reproduce the same problem on both 7u40 and 8.
ILW=MMM=P3