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

Use common code in function unmap_shared() in perfMemory_posix.cpp

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b10

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hseigel Harold Seigel
              Reporter:
              hseigel Harold Seigel
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: