RFR: 8370254: Add VM_MEMORY_JAVA mmap tag to MacOS mmap calls

Nityanand Rai duke at openjdk.org
Wed Oct 29 17:42:08 UTC 2025


On Tue, 21 Oct 2025 20:53:21 GMT, Nityanand Rai <duke at openjdk.org> wrote:

>> Add VM_MEMORY_JAVA tag to mmap calls in os_bsd.cpp for better memory tracking of java process on macOs
>
>> Imo, be a good idea to include os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp, which has 3 uses that should probably be marked with VM_MEMORY_JAVA. #if defined(**APPLE**) of course.
> 
> Covered ZGC direct mmap calls as well

> @nityarai08 ,
> 
> What macOS and Xcode versions are required to support `VM_MEMORY_JAVA` tag?
> 
> OpenJDK macOS recommendation:
> 
> > It is recommended that you use at least macOS 14 and Xcode 15.4, but earlier versions may also work.
> 
> It would be nice to have a gtest.

Added a gtest and validated on macOS 15.6.1 and Xcode 16.2

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

PR Comment: https://git.openjdk.org/jdk/pull/27868#issuecomment-3429522593


More information about the hotspot-runtime-dev mailing list