JDK-8054546 : NMT2 leaks memory
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-08-07
  • Updated: 2015-06-03
  • Resolved: 2014-08-20
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.
JDK 8 JDK 9
8u40Fixed 9 b30Fixed
Description
NMT2 detects memory leak in NMT2 implementation.

NMT2 tries to baseline memory into an arena. Virtual memory's reserved regions (ReservedMemoryRegion) are baselined into the arena, however, the committed regions (CommittedMemoryRegion) inside the reserved regions are allocated on C heap.

When the baseline is discarded, it simply discards the arena, which do not invoke ReservedMemoryRegion's dtor, therefore, committed regions are not free. 

[0x000000005f14eb29] ResourceObj::operator new+0x99
[0x000000005f5905da] SortedLinkedList<CommittedMemoryRegion,&compare_committed_region,2,10,1>::add+0x2a
[0x000000005f58e20f] ReservedMemoryRegion::operator=+0xef
[0x000000005f590918] LinkedListNode<ReservedMemoryRegion>::LinkedListNode<ReservedMemoryRegion>+0x78
                             (malloc=5KB +5KB #54 +54)