RFR: 8356228: NMT does not record reserved memory base address correctly

Afshin Zafari azafari at openjdk.org
Tue Jun 10 11:29:42 UTC 2025


The problem here stems from the following facts:
1) When requesting an aligned virtual memory, the size may be extended to meet the alignment requirements. The extra size from the two ends are released afterward. 
2) NMT ignores tracking of releasing CDS regions that are contained in larger regions, because they should be in a specific order.
3) In linux-aarch64 environment, the alignment size is 64K, reserve operations may fall into cases as 1) above.

So, if ArchiveBuffer memory is reserved with CDS tag, there might be some released regions that NMT ignored and then later complains their intersection with other regions (e.g., thread stack regions observed in the issue).

Solution is to reserve the memory with no tag (mtNone) and if it succeeds change the tag of the region to CDS for further trackings.

Tests:
linux-x64: runtime/NMT jtreg tests passed
linux-aarch64: tier1 to tier3 passed

-------------

Commit messages:
 - 8356228: NMT does not record reserved memory base address correctly

Changes: https://git.openjdk.org/jdk/pull/25719/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25719&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8356228
  Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/25719.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25719/head:pull/25719

PR: https://git.openjdk.org/jdk/pull/25719


More information about the hotspot-runtime-dev mailing list