98 _old_gen = new PSOldGen(init_low_byte_size, 99 min_low_byte_size, 100 max_low_byte_size, 101 "old", 1); 102 103 // The virtual spaces are created by the initialization of the gens. 104 _young_gen->initialize(young_rs, alignment); 105 assert(young_gen()->gen_size_limit() == young_rs.size(), 106 "Consistency check"); 107 _old_gen->initialize(old_rs, alignment, "old", 1); 108 assert(old_gen()->gen_size_limit() == old_rs.size(), "Consistency check"); 109 } 110 } 111 112 size_t AdjoiningGenerations::reserved_byte_size() { 113 return virtual_spaces()->reserved_space().size(); 114 } 115 116 117 // Make checks on the current sizes of the generations and 118 // the contraints on the sizes of the generations. Push 119 // up the boundary within the contraints. A partial 120 // push can occur. 121 void AdjoiningGenerations::request_old_gen_expansion(size_t expand_in_bytes) { 122 assert(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary, "runtime check"); 123 124 assert_lock_strong(ExpandHeap_lock); 125 assert_locked_or_safepoint(Heap_lock); 126 127 // These sizes limit the amount the boundaries can move. Effectively, 128 // the generation says how much it is willing to yield to the other 129 // generation. 130 const size_t young_gen_available = young_gen()->available_for_contraction(); 131 const size_t old_gen_available = old_gen()->available_for_expansion(); 132 const size_t alignment = virtual_spaces()->alignment(); 133 size_t change_in_bytes = MIN3(young_gen_available, 134 old_gen_available, 135 align_size_up_(expand_in_bytes, alignment)); 136 137 if (change_in_bytes == 0) { 138 return; 139 } | 98 _old_gen = new PSOldGen(init_low_byte_size, 99 min_low_byte_size, 100 max_low_byte_size, 101 "old", 1); 102 103 // The virtual spaces are created by the initialization of the gens. 104 _young_gen->initialize(young_rs, alignment); 105 assert(young_gen()->gen_size_limit() == young_rs.size(), 106 "Consistency check"); 107 _old_gen->initialize(old_rs, alignment, "old", 1); 108 assert(old_gen()->gen_size_limit() == old_rs.size(), "Consistency check"); 109 } 110 } 111 112 size_t AdjoiningGenerations::reserved_byte_size() { 113 return virtual_spaces()->reserved_space().size(); 114 } 115 116 117 // Make checks on the current sizes of the generations and 118 // the constraints on the sizes of the generations. Push 119 // up the boundary within the constraints. A partial 120 // push can occur. 121 void AdjoiningGenerations::request_old_gen_expansion(size_t expand_in_bytes) { 122 assert(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary, "runtime check"); 123 124 assert_lock_strong(ExpandHeap_lock); 125 assert_locked_or_safepoint(Heap_lock); 126 127 // These sizes limit the amount the boundaries can move. Effectively, 128 // the generation says how much it is willing to yield to the other 129 // generation. 130 const size_t young_gen_available = young_gen()->available_for_contraction(); 131 const size_t old_gen_available = old_gen()->available_for_expansion(); 132 const size_t alignment = virtual_spaces()->alignment(); 133 size_t change_in_bytes = MIN3(young_gen_available, 134 old_gen_available, 135 align_size_up_(expand_in_bytes, alignment)); 136 137 if (change_in_bytes == 0) { 138 return; 139 } |