--- old/src/os/posix/vm/os_posix.cpp 2016-04-01 17:05:27.028927611 -0700 +++ new/src/os/posix/vm/os_posix.cpp 2016-04-01 17:05:26.964927610 -0700 @@ -136,6 +136,21 @@ return; } +// Reserve memory by creating a temporary file in the provided directory and using it for mmap() call +// This function is only relevant to Linux. Report failure when called for other OSes +char* os::reserve_memory_with_backing_file(size_t bytes, char* requested_addr, size_t alignment_hint, const char* backingFileDir) { +#ifdef TARGET_OS_FAMILY_linux + char* result = os::Linux::reserve_memory_with_backing_file(bytes, requested_addr, alignment_hint, backingFileDir); + if (result != NULL) { + MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC); + } + return result; +#else + VMError::report_and_die("Allocating object heap with backing file is not supported for this OS"); + return NULL; +#endif +} + // Multiple threads can race in this code, and can remap over each other with MAP_FIXED, // so on posix, unmap the section at the start and at the end of the chunk that we mapped // rather than unmapping and remapping the whole chunk to get requested alignment.