diff options
Diffstat (limited to 'runtime/runtime.cc')
| -rw-r--r-- | runtime/runtime.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index cd09bee4e6..6c459a3950 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -140,6 +140,12 @@ namespace art { // If a signal isn't handled properly, enable a handler that attempts to dump the Java stack. static constexpr bool kEnableJavaStackTraceHandler = false; +// Tuned by compiling GmsCore under perf and measuring time spent in DescriptorEquals for class +// linking. +static constexpr double kLowMemoryMinLoadFactor = 0.5; +static constexpr double kLowMemoryMaxLoadFactor = 0.8; +static constexpr double kNormalMinLoadFactor = 0.4; +static constexpr double kNormalMaxLoadFactor = 0.7; Runtime* Runtime::instance_ = nullptr; struct TraceConfig { @@ -200,7 +206,9 @@ Runtime::Runtime() no_sig_chain_(false), is_native_bridge_loaded_(false), zygote_max_failed_boots_(0), - experimental_flags_(ExperimentalFlags::kNone) { + experimental_flags_(ExperimentalFlags::kNone), + oat_file_manager_(nullptr), + is_low_memory_mode_(false) { CheckAsmSupportOffsetsAndSizes(); std::fill(callee_save_methods_, callee_save_methods_ + arraysize(callee_save_methods_), 0u); } @@ -886,6 +894,7 @@ bool Runtime::Init(const RuntimeOptions& raw_options, bool ignore_unrecognized) zygote_max_failed_boots_ = runtime_options.GetOrDefault(Opt::ZygoteMaxFailedBoots); experimental_flags_ = runtime_options.GetOrDefault(Opt::Experimental); + is_low_memory_mode_ = runtime_options.Exists(Opt::LowMemoryMode); XGcOption xgc_option = runtime_options.GetOrDefault(Opt::GcOption); ATRACE_BEGIN("CreateHeap"); @@ -1804,4 +1813,12 @@ LinearAlloc* Runtime::CreateLinearAlloc() { : new LinearAlloc(arena_pool_.get()); } +double Runtime::GetHashTableMinLoadFactor() const { + return is_low_memory_mode_ ? kLowMemoryMinLoadFactor : kNormalMinLoadFactor; +} + +double Runtime::GetHashTableMaxLoadFactor() const { + return is_low_memory_mode_ ? kLowMemoryMaxLoadFactor : kNormalMaxLoadFactor; +} + } // namespace art |