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

Split os::reserve_memory and os::map_memory_to_file interfaces

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b22

      Description

      reserve_memory and map_memory_to_file are substantially different interfaces. Reserve expects subsequent commit/uncommit and is removed by release_memory. Map_memory_to_file does not allow commit/uncommit and is removed by os::unmap_memory.

      But for now, some os::*reserve_memory* functions take file descriptor parameter[1] and, if it is valid descriptor, act effectively as map_memory_to_file[2]. Callers are aware that commit/uncommit cannot be called for reserved-with-fd memory[3]. Callers are also know about different ways to remove the mapping[4].

      The suggestion is to make clear distinctions between reserve_memory and map_memory_to_file interfaces

      [1] https://github.com/openjdk/jdk/blob/4634dbe/src/hotspot/share/runtime/os.hpp#L321
      [2] https://github.com/openjdk/jdk/blob/4634dbe/src/hotspot/share/runtime/os.cpp#L1667
      [3] https://github.com/openjdk/jdk/blob/4634dbe/src/hotspot/share/memory/virtualspace.cpp#L225
      [4]https://github.com/openjdk/jdk/blob/4634dbe/src/hotspot/share/memory/virtualspace.cpp#L84

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              akozlov Anton Kozlov
              Reporter:
              akozlov Anton Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: