diff options
author | David Srbecky <dsrbecky@google.com> | 2021-02-16 14:06:31 +0000 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2021-02-23 15:24:27 +0000 |
commit | 1214319d27e7fb4c4ff00b39799df6f15288098a (patch) | |
tree | 8708943822a634322bd9790c4d008210e44b3ddb /openjdkjvmti | |
parent | b7cb691fb8da124e8a6276a5a7fee47dd0aaa338 (diff) |
Lazily allocate DexCache arrays.
We rarely need the DexCache for compiled code.
Delay the allocation in hope we never need it.
This reduces DexCache memory usage by ~25% at startup.
Test: m test-art-host-gtest
Test: test.py -r -b --host
Change-Id: I680a59c905c2b821ee954e4b32abd5d24876bd11
Diffstat (limited to 'openjdkjvmti')
-rw-r--r-- | openjdkjvmti/ti_redefine.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/openjdkjvmti/ti_redefine.cc b/openjdkjvmti/ti_redefine.cc index 12d00ad052..3e841e76e9 100644 --- a/openjdkjvmti/ti_redefine.cc +++ b/openjdkjvmti/ti_redefine.cc @@ -759,9 +759,7 @@ art::mirror::DexCache* Redefiner::ClassRedefinition::CreateNewDexCache( } art::WriterMutexLock mu(driver_->self_, *art::Locks::dex_lock_); cache->SetLocation(location.Get()); - cache->InitializeNativeFields(dex_file_.get(), - loader.IsNull() ? driver_->runtime_->GetLinearAlloc() - : loader->GetAllocator()); + cache->Initialize(dex_file_.get(), loader.Get()); return cache.Get(); } |