Skip to content

Commit bd8693a

Browse files
author
Thomas Schatzl
committed
8256181: Remove Allocation of old generation on alternate memory devices functionality
Reviewed-by: ayang, iignatyev, iklam
1 parent 4df8abc commit bd8693a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+132
-2311
lines changed

src/hotspot/os/linux/os_linux.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4624,7 +4624,7 @@ jint os::init_2(void) {
46244624
// initialize thread priority policy
46254625
prio_init();
46264626

4627-
if (!FLAG_IS_DEFAULT(AllocateHeapAt) || !FLAG_IS_DEFAULT(AllocateOldGenAt)) {
4627+
if (!FLAG_IS_DEFAULT(AllocateHeapAt)) {
46284628
set_coredump_filter(DAX_SHARED_BIT);
46294629
}
46304630

src/hotspot/share/gc/g1/g1Arguments.cpp

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
#include "runtime/globals_extension.hpp"
3737
#include "runtime/java.hpp"
3838

39-
static const double MaxRamFractionForYoung = 0.8;
40-
size_t G1Arguments::MaxMemoryForYoung;
41-
4239
static size_t calculate_heap_alignment(size_t space_alignment) {
4340
size_t card_table_alignment = CardTableRS::ct_max_alignment_constraint();
4441
size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
@@ -194,85 +191,15 @@ void G1Arguments::initialize() {
194191
initialize_verification_types();
195192
}
196193

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-
227194
void G1Arguments::initialize_heap_flags_and_sizes() {
228-
if (AllocateOldGenAt != NULL) {
229-
initialize_heterogeneous();
230-
}
231-
232195
GCArguments::initialize_heap_flags_and_sizes();
233196
}
234197

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-
260198
CollectedHeap* G1Arguments::create_heap() {
261199
return new G1CollectedHeap();
262200
}
263201

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-
272202
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() {
277203
return MaxHeapSize;
278204
}
205+

src/hotspot/share/gc/g1/g1Arguments.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,19 @@ class CollectedHeap;
3333
class G1Arguments : public GCArguments {
3434
friend class G1HeapVerifierTest;
3535

36-
private:
37-
static size_t MaxMemoryForYoung;
38-
3936
static void initialize_mark_stack_size();
4037
static void initialize_verification_types();
4138
static void parse_verification_type(const char* type);
4239

4340
virtual void initialize_alignments();
4441
virtual void initialize_heap_flags_and_sizes();
4542

46-
void initialize_heterogeneous();
47-
4843
virtual void initialize();
4944
virtual size_t conservative_max_heap_alignment();
5045
virtual CollectedHeap* create_heap();
5146

5247
public:
53-
// Heterogeneous heap support
54-
static bool is_heterogeneous_heap();
55-
static size_t reasonable_max_memory_for_young();
5648
static size_t heap_reserved_size_bytes();
57-
static size_t heap_max_size_bytes();
5849
};
5950

6051
#endif // SHARE_GC_G1_G1ARGUMENTS_HPP

0 commit comments

Comments
 (0)