diff options
author | 2021-09-30 14:36:32 +0000 | |
---|---|---|
committer | 2021-10-07 12:10:32 +0000 | |
commit | 33df0e3e47adc053c34a0ad3f4bb78ee3dd40e7f (patch) | |
tree | 401957f10b116a082e7c4ed58bb86bff3c4e2615 /runtime/class_linker_test.cc | |
parent | ce8198e1e826142a5dc032f22a60e2c41eaeff96 (diff) |
Revert^4 "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.
Bug: b/181097963
Test: test.py -b --host
Change-Id: I1f654aeb538dfed013705a61b1955af1f6b94fe7
Diffstat (limited to 'runtime/class_linker_test.cc')
-rw-r--r-- | runtime/class_linker_test.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc index 035a9cbfa5..e1831465c0 100644 --- a/runtime/class_linker_test.cc +++ b/runtime/class_linker_test.cc @@ -1542,8 +1542,9 @@ TEST_F(ClassLinkerTest, RegisterDexFileName) { nullptr, nullptr)); // Make a copy of the dex cache with changed name. - LinearAlloc* alloc = Runtime::Current()->GetLinearAlloc(); - dex_cache.Assign(class_linker->AllocAndInitializeDexCache(Thread::Current(), *dex_file, alloc)); + dex_cache.Assign(class_linker->AllocAndInitializeDexCache(Thread::Current(), + *dex_file, + /* class_loader= */ nullptr)); DCHECK_EQ(dex_cache->GetLocation()->CompareTo(location.Get()), 0); { WriterMutexLock mu(soa.Self(), *Locks::dex_lock_); |