--- old/share/gc/parallel/psOldGen.cpp 2018-06-15 09:47:38.602912459 -0700 +++ new/share/gc/parallel/psOldGen.cpp 2018-06-15 09:47:38.574912458 -0700 @@ -72,9 +72,24 @@ void PSOldGen::initialize_virtual_space(ReservedSpace rs, size_t alignment) { _virtual_space = new PSVirtualSpace(rs, alignment); - if (!_virtual_space->expand_by(_init_gen_size)) { - vm_exit_during_initialization("Could not reserve enough space for " - "object heap"); + if (os::has_nvdimm() && UseParallelOldGC) { + if (!_virtual_space->expand_by(_init_gen_size, _nvdimm_fd)) { + vm_exit_during_initialization("Could not reserve enough space for " + "object heap"); + } +#if defined (_WINDOWS) + // Windows OS does not support incremental mapping for DAX (NVDIMM) File System + if (os::has_nvdimm()) { + os::close(os::nvdimm_fd()); + } +#endif + os::set_nvdimm_heapbase((address)(_virtual_space->reserved_low_addr())); + os::set_dram_heapbase((address)((char*)_virtual_space->reserved_low_addr() + _max_gen_size)); + } else { + if (!_virtual_space->expand_by(_init_gen_size)) { + vm_exit_during_initialization("Could not reserve enough space for " + "object heap"); + } } } @@ -275,7 +290,12 @@ if (bytes == 0) { return true; // That's what virtual_space()->expand_by(0) would return } - bool result = virtual_space()->expand_by(bytes); + bool result = false; + if (os::has_nvdimm() && UseParallelOldGC) { + result = virtual_space()->expand_by(bytes, nvdimm_fd()); + } else { + result = virtual_space()->expand_by(bytes); + } if (result) { if (ZapUnusedHeapArea) { // We need to mangle the newly expanded area. The memregion spans