< prev index next >
share/gc/g1/g1CollectedHeap.cpp
Print this page
rev 1 : G1GC+POGC+NVDIMM Patch with latest comments incorporated from all.
*** 1314,1325 ****
return NULL;
}
bool G1CollectedHeap::expand(size_t expand_bytes, WorkGang* pretouch_workers, double* expand_time_ms) {
size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes);
! aligned_expand_bytes = align_up(aligned_expand_bytes,
! HeapRegion::GrainBytes);
log_debug(gc, ergo, heap)("Expand the heap. requested expansion amount: " SIZE_FORMAT "B expansion amount: " SIZE_FORMAT "B",
expand_bytes, aligned_expand_bytes);
if (is_maximal_no_gc()) {
--- 1314,1324 ----
return NULL;
}
bool G1CollectedHeap::expand(size_t expand_bytes, WorkGang* pretouch_workers, double* expand_time_ms) {
size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes);
! aligned_expand_bytes = align_up(aligned_expand_bytes, HeapRegion::GrainBytes);
log_debug(gc, ergo, heap)("Expand the heap. requested expansion amount: " SIZE_FORMAT "B expansion amount: " SIZE_FORMAT "B",
expand_bytes, aligned_expand_bytes);
if (is_maximal_no_gc()) {
*** 1561,1571 ****
// Create the hot card cache.
_hot_card_cache = new G1HotCardCache(this);
// Carve out the G1 part of the heap.
! ReservedSpace g1_rs = heap_rs.first_part(max_byte_size);
size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
G1RegionToSpaceMapper* heap_storage =
G1RegionToSpaceMapper::create_mapper(g1_rs,
g1_rs.size(),
page_size,
--- 1560,1570 ----
// Create the hot card cache.
_hot_card_cache = new G1HotCardCache(this);
// Carve out the G1 part of the heap.
! ReservedSpace g1_rs = heap_rs.first_part(heap_rs.size());
size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
G1RegionToSpaceMapper* heap_storage =
G1RegionToSpaceMapper::create_mapper(g1_rs,
g1_rs.size(),
page_size,
*** 1644,1659 ****
--- 1643,1669 ----
vm_shutdown_during_initialization("Could not create/initialize G1ConcurrentMark");
return JNI_ENOMEM;
}
_cm_thread = _cm->cm_thread();
+ // Expand NVDIMM to maximum old gen size.
+ size_t aligned_expand_bytes = 0;
+ if (os::has_nvdimm()) {
+ aligned_expand_bytes = expand_old_gen_on_nvdimm(max_byte_size);
+ }
// Now expand into the initial heap size.
if (!expand(init_byte_size, _workers)) {
vm_shutdown_during_initialization("Failed to allocate initial heap.");
return JNI_ENOMEM;
}
+ if (os::has_nvdimm()) {
+ // Show how much memory was committed on NVDIMM and DRAM.
+ log_info(gc, heap)("NVDIMM Reserved Bytes : %ld DRAM Reserved Bytes : %ld \n", aligned_expand_bytes, init_byte_size);
+ log_info(gc, heap)("When NVDIMM is present, we always reserve and commit Maximum OldGen Size on NVDIMM");
+ log_info(gc, heap)("JVM will have more size reserved and committed than specified by Xmn or Xms options (but never more than Xmx).");
+ }
// Perform any initialization actions delegated to the policy.
g1_policy()->init(this, &_collection_set);
G1BarrierSet::satb_mark_queue_set().initialize(SATB_Q_CBL_mon,
SATB_Q_FL_lock,
*** 1711,1720 ****
--- 1721,1740 ----
_collection_set.initialize(max_regions());
return JNI_OK;
}
+ size_t G1CollectedHeap::expand_old_gen_on_nvdimm(size_t max_byte_size) {
+ size_t nvdimm_bytes = max_byte_size - (size_t)(max_byte_size * G1MaxNewSizePercent)/100;
+ size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(nvdimm_bytes);
+ aligned_expand_bytes = align_up(aligned_expand_bytes, HeapRegion::GrainBytes);
+ uint nvdimm_regions = (uint)(aligned_expand_bytes/HeapRegion::GrainBytes);
+ os::set_nvdimm_regionlength(nvdimm_regions);
+ expand(aligned_expand_bytes, _workers);
+ return aligned_expand_bytes;
+ }
+
void G1CollectedHeap::initialize_serviceability() {
_eden_pool = new G1EdenPool(this);
_survivor_pool = new G1SurvivorPool(this);
_old_pool = new G1OldGenPool(this);
< prev index next >