< prev index next >
src/hotspot/share/memory/virtualspace.cpp
Print this page
*** 211,221 ****
// Done
_base = base;
_size = size;
_alignment = alignment;
// If heap is reserved with a backing file, the entire space has been committed. So set the _special flag to true
! if (_fd_for_heap != -1) {
_special = true;
}
}
--- 211,221 ----
// Done
_base = base;
_size = size;
_alignment = alignment;
// If heap is reserved with a backing file, the entire space has been committed. So set the _special flag to true
! if (_fd_for_heap != -1 && AllocateOldGenAt == NULL) {
_special = true;
}
}
*** 319,329 ****
assert(Universe::narrow_oop_use_implicit_null_checks() == true, "not initialized?");
} else {
Universe::set_narrow_oop_use_implicit_null_checks(false);
}
}
-
_base += _noaccess_prefix;
_size -= _noaccess_prefix;
assert(((uintptr_t)_base % _alignment == 0), "must be exactly of required alignment");
}
--- 319,328 ----
*** 401,411 ****
_base = base;
_size = size;
_alignment = alignment;
// If heap is reserved with a backing file, the entire space has been committed. So set the _special flag to true
! if (_fd_for_heap != -1) {
_special = true;
}
// Check alignment constraints
if ((((size_t)base) & (alignment - 1)) != 0) {
--- 400,410 ----
_base = base;
_size = size;
_alignment = alignment;
// If heap is reserved with a backing file, the entire space has been committed. So set the _special flag to true
! if (_fd_for_heap != -1 && AllocateOldGenAt == NULL) {
_special = true;
}
// Check alignment constraints
if ((((size_t)base) & (alignment - 1)) != 0) {
*** 605,614 ****
--- 604,628 ----
if (size == 0) {
return;
}
+ // Open AllocateOldGenAt file
+ if (AllocateOldGenAt != NULL) {
+ _fd_for_heap = os::create_file_for_heap(AllocateOldGenAt);
+ if (_fd_for_heap== -1) {
+ vm_exit_during_initialization(
+ err_msg("Could not create file for Heap at location %s", AllocateOldGenAt));
+ }
+ // Allocate space on device.
+ os::allocate_file(_fd_for_heap, MaxHeapSize);
+ os::set_nvdimm_fd(_fd_for_heap);
+ os::set_nvdimm_present(true);
+ } else {
+ _fd_for_heap = -1;
+ }
+
if (heap_allocation_directory != NULL) {
_fd_for_heap = os::create_file_for_heap(heap_allocation_directory);
if (_fd_for_heap == -1) {
vm_exit_during_initialization(
err_msg("Could not create file for Heap at location %s", heap_allocation_directory));
*** 635,647 ****
assert(markOopDesc::encode_pointer_as_mark(&_base[size])->decode_pointer() == &_base[size],
"area must be distinguishable from marks for mark-sweep");
if (base() != NULL) {
MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
}
! if (_fd_for_heap != -1) {
os::close(_fd_for_heap);
}
}
// Reserve space for code segment. Same as Java heap only we mark this as
--- 649,664 ----
assert(markOopDesc::encode_pointer_as_mark(&_base[size])->decode_pointer() == &_base[size],
"area must be distinguishable from marks for mark-sweep");
if (base() != NULL) {
MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+ if (AllocateOldGenAt != NULL && _fd_for_heap != -1) {
+ os::set_nvdimm_heapbase((address)_base);
+ }
}
! if (_fd_for_heap != -1 && AllocateOldGenAt == NULL) {
os::close(_fd_for_heap);
}
}
// Reserve space for code segment. Same as Java heap only we mark this as
< prev index next >