RFR: 8146523: Incorrect memory tracker used by os::unmap_memory()

Jiangli Zhou jiangli.zhou at Oracle.COM
Tue Jan 5 22:30:36 UTC 2016


Please review the small fix for JDK-8146523 <https://bugs.openjdk.java.net/browse/JDK-8146523>:


The os::map_memory() and os:unmapp_memory() functions use the memory tracker asymmetrically. The os::map_memory() function calls MemTracker::record_virtual_memory_reserve_and_commit() to track the mapped memory, while os::unmap_memory() uses the 'virtual_memory_release_tracker' to track the memory being unmapped. In NMT, there are different types of tracker for releasing and uncommitting memory. The ‘virtual_memory_uncommit_tracker' is for 'uncommit’ and ‘virtual_memory_release_tracker’ is for 'release'. The os::unmap_memory() should use the ‘virtual_memory_uncommit_tracker' to be balanced with os::map_memory().

Tested with test/runtime/NMT.


More information about the hotspot-runtime-dev mailing list