105 max_high_byte_size);
106 _old_gen = new PSOldGen(init_low_byte_size,
107 min_low_byte_size,
108 max_low_byte_size,
109 "old", 1);
110
111 // The virtual spaces are created by the initialization of the gens.
112 _young_gen->initialize(young_rs, alignment);
113 assert(young_gen()->gen_size_limit() == young_rs.size(),
114 "Consistency check");
115 _old_gen->initialize(old_rs, alignment, "old", 1);
116 assert(old_gen()->gen_size_limit() == old_rs.size(), "Consistency check");
117 }
118 }
119
120 size_t AdjoiningGenerations::reserved_byte_size() {
121 return virtual_spaces()->reserved_space().size();
122 }
123
124 void log_before_expansion(bool old, size_t expand_in_bytes, size_t change_in_bytes, size_t max_size) {
125 Log(heap, ergo) log;
126 if (!log.is_debug()) {
127 return;
128 }
129 log.debug("Before expansion of %s gen with boundary move", old ? "old" : "young");
130 log.debug(" Requested change: " SIZE_FORMAT_HEX " Attempted change: " SIZE_FORMAT_HEX,
131 expand_in_bytes, change_in_bytes);
132 ResourceMark rm;
133 LogStream ls(log.debug());
134 ParallelScavengeHeap::heap()->print_on(&ls);
135 log.debug(" PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K);
136 }
137
138 void log_after_expansion(bool old, size_t max_size) {
139 Log(heap, ergo) log;
140 if (!log.is_debug()) {
141 return;
142 }
143 log.debug("After expansion of %s gen with boundary move", old ? "old" : "young");
144 ResourceMark rm;
145 LogStream ls(log.debug());
146 ParallelScavengeHeap::heap()->print_on(&ls);
147 log.debug(" PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K);
148 }
149
150 // Make checks on the current sizes of the generations and
151 // the constraints on the sizes of the generations. Push
152 // up the boundary within the constraints. A partial
153 // push can occur.
154 void AdjoiningGenerations::request_old_gen_expansion(size_t expand_in_bytes) {
155 assert(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary, "runtime check");
156
157 assert_lock_strong(ExpandHeap_lock);
158 assert_locked_or_safepoint(Heap_lock);
159
|
105 max_high_byte_size);
106 _old_gen = new PSOldGen(init_low_byte_size,
107 min_low_byte_size,
108 max_low_byte_size,
109 "old", 1);
110
111 // The virtual spaces are created by the initialization of the gens.
112 _young_gen->initialize(young_rs, alignment);
113 assert(young_gen()->gen_size_limit() == young_rs.size(),
114 "Consistency check");
115 _old_gen->initialize(old_rs, alignment, "old", 1);
116 assert(old_gen()->gen_size_limit() == old_rs.size(), "Consistency check");
117 }
118 }
119
120 size_t AdjoiningGenerations::reserved_byte_size() {
121 return virtual_spaces()->reserved_space().size();
122 }
123
124 void log_before_expansion(bool old, size_t expand_in_bytes, size_t change_in_bytes, size_t max_size) {
125 Log(gc, heap, ergo) log;
126 if (!log.is_debug()) {
127 return;
128 }
129 log.debug("Before expansion of %s gen with boundary move", old ? "old" : "young");
130 log.debug(" Requested change: " SIZE_FORMAT_HEX " Attempted change: " SIZE_FORMAT_HEX,
131 expand_in_bytes, change_in_bytes);
132 ResourceMark rm;
133 LogStream ls(log.debug());
134 ParallelScavengeHeap::heap()->print_on(&ls);
135 log.debug(" PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K);
136 }
137
138 void log_after_expansion(bool old, size_t max_size) {
139 Log(gc, heap, ergo) log;
140 if (!log.is_debug()) {
141 return;
142 }
143 log.debug("After expansion of %s gen with boundary move", old ? "old" : "young");
144 ResourceMark rm;
145 LogStream ls(log.debug());
146 ParallelScavengeHeap::heap()->print_on(&ls);
147 log.debug(" PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K);
148 }
149
150 // Make checks on the current sizes of the generations and
151 // the constraints on the sizes of the generations. Push
152 // up the boundary within the constraints. A partial
153 // push can occur.
154 void AdjoiningGenerations::request_old_gen_expansion(size_t expand_in_bytes) {
155 assert(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary, "runtime check");
156
157 assert_lock_strong(ExpandHeap_lock);
158 assert_locked_or_safepoint(Heap_lock);
159
|