|
36 | 36 | #include "runtime/globals_extension.hpp"
|
37 | 37 | #include "runtime/java.hpp"
|
38 | 38 |
|
39 |
| -static const double MaxRamFractionForYoung = 0.8; |
40 |
| -size_t G1Arguments::MaxMemoryForYoung; |
41 |
| - |
42 | 39 | static size_t calculate_heap_alignment(size_t space_alignment) {
|
43 | 40 | size_t card_table_alignment = CardTableRS::ct_max_alignment_constraint();
|
44 | 41 | size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
|
@@ -194,85 +191,15 @@ void G1Arguments::initialize() {
|
194 | 191 | initialize_verification_types();
|
195 | 192 | }
|
196 | 193 |
|
197 |
| -static size_t calculate_reasonable_max_memory_for_young(FormatBuffer<100> &calc_str, double max_ram_fraction_for_young) { |
198 |
| - julong phys_mem; |
199 |
| - // If MaxRam is specified, we use that as maximum physical memory available. |
200 |
| - if (FLAG_IS_DEFAULT(MaxRAM)) { |
201 |
| - phys_mem = os::physical_memory(); |
202 |
| - calc_str.append("Physical_Memory"); |
203 |
| - } else { |
204 |
| - phys_mem = (julong)MaxRAM; |
205 |
| - calc_str.append("MaxRAM"); |
206 |
| - } |
207 |
| - |
208 |
| - julong reasonable_max = phys_mem; |
209 |
| - |
210 |
| - // If either MaxRAMFraction or MaxRAMPercentage is specified, we use them to calculate |
211 |
| - // reasonable max size of young generation. |
212 |
| - if (!FLAG_IS_DEFAULT(MaxRAMFraction)) { |
213 |
| - reasonable_max = (julong)(phys_mem / MaxRAMFraction); |
214 |
| - calc_str.append(" / MaxRAMFraction"); |
215 |
| - } else if (!FLAG_IS_DEFAULT(MaxRAMPercentage)) { |
216 |
| - reasonable_max = (julong)((phys_mem * MaxRAMPercentage) / 100); |
217 |
| - calc_str.append(" * MaxRAMPercentage / 100"); |
218 |
| - } else { |
219 |
| - // We use our own fraction to calculate max size of young generation. |
220 |
| - reasonable_max = phys_mem * max_ram_fraction_for_young; |
221 |
| - calc_str.append(" * %0.2f", max_ram_fraction_for_young); |
222 |
| - } |
223 |
| - |
224 |
| - return (size_t)reasonable_max; |
225 |
| -} |
226 |
| - |
227 | 194 | void G1Arguments::initialize_heap_flags_and_sizes() {
|
228 |
| - if (AllocateOldGenAt != NULL) { |
229 |
| - initialize_heterogeneous(); |
230 |
| - } |
231 |
| - |
232 | 195 | GCArguments::initialize_heap_flags_and_sizes();
|
233 | 196 | }
|
234 | 197 |
|
235 |
| -void G1Arguments::initialize_heterogeneous() { |
236 |
| - FormatBuffer<100> calc_str(""); |
237 |
| - |
238 |
| - MaxMemoryForYoung = calculate_reasonable_max_memory_for_young(calc_str, MaxRamFractionForYoung); |
239 |
| - |
240 |
| - if (MaxNewSize > MaxMemoryForYoung) { |
241 |
| - if (FLAG_IS_CMDLINE(MaxNewSize)) { |
242 |
| - log_warning(gc, ergo)("Setting MaxNewSize to " SIZE_FORMAT " based on dram available (calculation = align(%s))", |
243 |
| - MaxMemoryForYoung, calc_str.buffer()); |
244 |
| - } else { |
245 |
| - log_info(gc, ergo)("Setting MaxNewSize to " SIZE_FORMAT " based on dram available (calculation = align(%s)). " |
246 |
| - "Dram usage can be lowered by setting MaxNewSize to a lower value", MaxMemoryForYoung, calc_str.buffer()); |
247 |
| - } |
248 |
| - MaxNewSize = MaxMemoryForYoung; |
249 |
| - } |
250 |
| - if (NewSize > MaxMemoryForYoung) { |
251 |
| - if (FLAG_IS_CMDLINE(NewSize)) { |
252 |
| - log_warning(gc, ergo)("Setting NewSize to " SIZE_FORMAT " based on dram available (calculation = align(%s))", |
253 |
| - MaxMemoryForYoung, calc_str.buffer()); |
254 |
| - } |
255 |
| - NewSize = MaxMemoryForYoung; |
256 |
| - } |
257 |
| - |
258 |
| -} |
259 |
| - |
260 | 198 | CollectedHeap* G1Arguments::create_heap() {
|
261 | 199 | return new G1CollectedHeap();
|
262 | 200 | }
|
263 | 201 |
|
264 |
| -bool G1Arguments::is_heterogeneous_heap() { |
265 |
| - return AllocateOldGenAt != NULL; |
266 |
| -} |
267 |
| - |
268 |
| -size_t G1Arguments::reasonable_max_memory_for_young() { |
269 |
| - return MaxMemoryForYoung; |
270 |
| -} |
271 |
| - |
272 | 202 | size_t G1Arguments::heap_reserved_size_bytes() {
|
273 |
| - return (is_heterogeneous_heap() ? 2 : 1) * MaxHeapSize; |
274 |
| -} |
275 |
| - |
276 |
| -size_t G1Arguments::heap_max_size_bytes() { |
277 | 203 | return MaxHeapSize;
|
278 | 204 | }
|
| 205 | + |
0 commit comments