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

Split os::reserve_memory and os::map_memory_to_file interfaces

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 16
    • 16
    • hotspot
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: