src/hotspot/share/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/hotspot/share/runtime/arguments.cpp	Tue Mar 12 10:52:35 2019
--- new/src/hotspot/share/runtime/arguments.cpp	Tue Mar 12 10:52:34 2019

*** 1606,1623 **** --- 1606,1618 ---- LP64_ONLY(return OopEncodingHeapMax - displacement_due_to_null_page); NOT_LP64(ShouldNotReachHere(); return 0); } ! void Arguments::set_use_compressed_oops(size_t max_heap_size) { #ifndef ZERO #ifdef _LP64 // MaxHeapSize is not set up properly at this point, but // the only value that can override MaxHeapSize if we are // to use UseCompressedOops is InitialHeapSize. size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize); if (max_heap_size <= max_heap_for_compressed_oops()) { #if !defined(COMPILER1) || defined(TIERED) if (FLAG_IS_DEFAULT(UseCompressedOops)) { FLAG_SET_ERGO(bool, UseCompressedOops, true); }
*** 1677,1699 **** --- 1672,1681 ---- jint Arguments::set_ergonomics_flags() { GCConfig::initialize(); set_conservative_max_heap_alignment(); #ifndef ZERO #ifdef _LP64 set_use_compressed_oops(); // set_use_compressed_klass_ptrs() must be called after calling // set_use_compressed_oops(). set_use_compressed_klass_ptrs(); // Also checks that certain machines are slower with compressed oops // in vm_version initialization code. #endif // _LP64 #endif // !ZERO return JNI_OK; } julong Arguments::limit_by_allocatable_memory(julong limit) { julong max_allocatable;
*** 1742,1751 **** --- 1724,1738 ---- if (!FLAG_IS_DEFAULT(ErgoHeapSizeLimit) && ErgoHeapSizeLimit != 0) { // Limit the heap size to ErgoHeapSizeLimit reasonable_max = MIN2(reasonable_max, (julong)ErgoHeapSizeLimit); } + + // Now that we have a more accurate MaxHeapSize, see if we can + // enable compressed oops. + set_use_compressed_oops(MAX2(reasonable_max, InitialHeapSize)); + if (UseCompressedOops) { // Limit the heap size to the maximum possible when using compressed oops julong max_coop_heap = (julong)max_heap_for_compressed_oops(); // HeapBaseMinAddress can be greater than default but not less than.
*** 1778,1787 **** --- 1765,1777 ---- reasonable_max = MAX2(reasonable_max, (julong)InitialHeapSize); } log_trace(gc, heap)(" Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max); FLAG_SET_ERGO(size_t, MaxHeapSize, (size_t)reasonable_max); + + } else { + set_use_compressed_oops(MaxHeapSize); } // If the minimum or initial heap_size have not been set or requested to be set // ergonomically, set them accordingly. if (InitialHeapSize == 0 || min_heap_size() == 0) {
*** 3857,3868 **** --- 3847,3863 ---- // Set flags based on ergonomics. jint result = set_ergonomics_flags(); if (result != JNI_OK) return result; // Set heap size based on available physical memory + // Also calls set_use_compressed_oops(). set_heap_size(); + // set_use_compressed_klass_ptrs() must be called after calling + // set_use_compressed_oops(). + set_use_compressed_klass_ptrs(); + GCConfig::arguments()->initialize(); set_shared_spaces_flags(); // Initialize Metaspace flags and alignments

src/hotspot/share/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File