--- old/src/hotspot/share/gc/parallel/adjoiningGenerations.cpp 2018-10-03 14:35:32.129335100 -0700 +++ new/src/hotspot/share/gc/parallel/adjoiningGenerations.cpp 2018-10-03 14:35:31.214458800 -0700 @@ -40,8 +40,8 @@ AdjoiningGenerations::AdjoiningGenerations(ReservedSpace old_young_rs, GenerationSizer* policy, size_t alignment) : - _virtual_spaces(old_young_rs, policy->min_old_size(), - policy->min_young_size(), alignment) { + _virtual_spaces(new AdjoiningVirtualSpaces(old_young_rs, policy->min_old_size(), + policy->min_young_size(), alignment)) { size_t init_low_byte_size = policy->initial_old_size(); size_t min_low_byte_size = policy->min_old_size(); size_t max_low_byte_size = policy->max_old_size(); @@ -61,21 +61,21 @@ // generation. // Does the actual creation of the virtual spaces - _virtual_spaces.initialize(max_low_byte_size, - init_low_byte_size, - init_high_byte_size); + _virtual_spaces->initialize(max_low_byte_size, + init_low_byte_size, + init_high_byte_size); // Place the young gen at the high end. Passes in the virtual space. - _young_gen = new ASPSYoungGen(_virtual_spaces.high(), - _virtual_spaces.high()->committed_size(), + _young_gen = new ASPSYoungGen(_virtual_spaces->high(), + _virtual_spaces->high()->committed_size(), min_high_byte_size, - _virtual_spaces.high_byte_size_limit()); + _virtual_spaces->high_byte_size_limit()); // Place the old gen at the low end. Passes in the virtual space. - _old_gen = new ASPSOldGen(_virtual_spaces.low(), - _virtual_spaces.low()->committed_size(), + _old_gen = new ASPSOldGen(_virtual_spaces->low(), + _virtual_spaces->low()->committed_size(), min_low_byte_size, - _virtual_spaces.low_byte_size_limit(), + _virtual_spaces->low_byte_size_limit(), "old", 1); young_gen()->initialize_work(); @@ -92,8 +92,9 @@ } else { // Layout the reserved space for the generations. + // If OldGen is allocated on nv-dimm, we need to split the reservation (this is required for windows). ReservedSpace old_rs = - virtual_spaces()->reserved_space().first_part(max_low_byte_size); + virtual_spaces()->reserved_space().first_part(max_low_byte_size, AllocateOldGenAt != NULL /* split */); ReservedSpace heap_rs = virtual_spaces()->reserved_space().last_part(max_low_byte_size); ReservedSpace young_rs = heap_rs.first_part(max_high_byte_size); @@ -117,6 +118,8 @@ } } +AdjoiningGenerations::AdjoiningGenerations() { } + size_t AdjoiningGenerations::reserved_byte_size() { return virtual_spaces()->reserved_space().size(); } @@ -278,4 +281,4 @@ request_young_gen_expansion(desired_size - committed); } } -} +} \ No newline at end of file