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