Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8370238

Use VM_MEMORY_JAVA tag for MAP_ANONYMOUS on macOS

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • hotspot

      On macOS we can tag anonymous memory allocated with mmap:

      ```
           MAP_ANON Map anonymous memory not associated with any specific file. The offset argument is ignored. Mac OS X specific: the file descriptor used for creating MAP_ANON regions can be used to pass some Mach VM flags, and can be specified as -1 if no such
                             flags are associated with the region. Mach VM flags are defined in <mach/vm_statistics.h> and the ones that currently apply to mmap are:

                             VM_FLAGS_PURGABLE to create Mach purgable (i.e. volatile) memory.

                             VM_MAKE_TAG(tag) to associate an 8-bit tag with the region.
                             <mach/vm_statistics.h> defines some preset tags (with a VM_MEMORY_ prefix). Users are encouraged to use tags between 240 and 255. Tags are used by tools such as vmmap(1) to help identify specific memory regions.
      ```

      There is VM_MEMORY_JAVA tag in vm_statistics.h, we can use it.

            Unassigned Unassigned
            eastigeevich Evgeny Astigeevich
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: