This issue came from @stuefe review of 8134540:
The existing code in unmap_shared() in perfMemory_posix.cpp differs between AIX and other platforms:
static void unmap_shared(char* addr, size_t bytes) {
#if defined(_AIX)
// Do not rely on os::reserve_memory/os::release_memory to use mmap.
// Use os::reserve_memory/os::release_memory for PerfDisableSharedMem=1, mmap/munmap for PerfDisableSharedMem=0
if (::munmap(addr, bytes) == -1) {
warning("perfmemory: munmap failed (%d)\n", errno);
}
#else
os::release_memory(addr, bytes);
#endif
}
The AIX code's explicit call to munmap would work for the other platforms but ignores memory tracking. The other code path works for AIX but, since on creation, we call raw ::mmap(). Then, perhaps we should call raw ::munmap here too. Otherwise this relies on the fact that os::reserve_memory always uses mmap(), which is not given.