In current version of NMT, two performance bottlenecks exist:
1- traversing SortedLinkLists of (address, size, flag, stack-trace) tuples for every NMT record (to keep track of virtual memory reserve/commit/uncommit/release operations)
2- all the find/add/remove/update of the list are done synchronously one thread at a time (using ThreadCritical).
In Summary mode, the NMT report does not show memory addresses or stack-trace info, but traversing the list is still required to match the reserve/release, commit/uncommit operations and/or setting the flags. It is possible to track only summary of (operation, size, flag) tuples without using neither list nor thread synchronizations. To do this, all `os::xxxxx_memory` API should provide this info to be able to keep/update the NMT record, and all updates of NMT summary metrics can be done atomically.
To implement this, the following tasks are to be done:
1- Changing `os::xxxx_memory` signatures to accept mandatory `MEMFLAGS flag` argument and using the flag for NMT tracking
2- Applying the change above to all the invocations
3- Changing some NMT API to support proper tracking
4- Adding new data structures and methods for Lightweight mode
5- Adding a new Lightweight mode to NMT
6- Adding new JTREG tests for Lightweight mode
Ultimately, the Lightweight mode can replace the Summary mode.
1- traversing SortedLinkLists of (address, size, flag, stack-trace) tuples for every NMT record (to keep track of virtual memory reserve/commit/uncommit/release operations)
2- all the find/add/remove/update of the list are done synchronously one thread at a time (using ThreadCritical).
In Summary mode, the NMT report does not show memory addresses or stack-trace info, but traversing the list is still required to match the reserve/release, commit/uncommit operations and/or setting the flags. It is possible to track only summary of (operation, size, flag) tuples without using neither list nor thread synchronizations. To do this, all `os::xxxxx_memory` API should provide this info to be able to keep/update the NMT record, and all updates of NMT summary metrics can be done atomically.
To implement this, the following tasks are to be done:
1- Changing `os::xxxx_memory` signatures to accept mandatory `MEMFLAGS flag` argument and using the flag for NMT tracking
2- Applying the change above to all the invocations
3- Changing some NMT API to support proper tracking
4- Adding new data structures and methods for Lightweight mode
5- Adding a new Lightweight mode to NMT
6- Adding new JTREG tests for Lightweight mode
Ultimately, the Lightweight mode can replace the Summary mode.
- duplicates
-
JDK-8312132 Add tracking of multiple address spaces in NMT
-
- Resolved
-