summaryrefslogtreecommitdiffstats
path: root/runtime/gc_root.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-10-31 11:49:27 -0700
committerMathieu Chartier <mathieuc@google.com>2014-11-03 10:17:41 -0800
commiteb175f70ef352ce0b9bcafdf06c5ac22b0ff626a (patch)
treea69840165ef62cd918c001a421373bec9121314d /runtime/gc_root.h
parent07f09809c0575e985249450843b06f266b831fe1 (diff)
downloadart-eb175f70ef352ce0b9bcafdf06c5ac22b0ff626a.tar.gz
art-eb175f70ef352ce0b9bcafdf06c5ac22b0ff626a.tar.bz2
art-eb175f70ef352ce0b9bcafdf06c5ac22b0ff626a.zip
Add image strings to intern table
When we create the runtime, we now add the image strings to the intern table if we are the zygote. This caused some memory bloat, so I added an extra unordered set to the intern table. There is now two unordered sets (hash talbe). One for pre-zygote interns and one for post-zygote interns. This helps since the pre-zygote hash table doesn't get dirtied. Even with adding the image strings, we get total memory savings of around 5-7 MB native PSS after device boot. FB launch Before: 2.20% art::DexFile::FindStringId(char const*) const TotalTime: 2069 TotalTime: 1985 TotalTime: 2088 TotalTime: 2003 TotalTime: 2034 TotalTime: 2049 After boot native PSS: 175585 kB: Native After: 0.27% art::DexFile::FindStringId(char const*) const TotalTime: 1682 TotalTime: 1756 TotalTime: 1825 TotalTime: 1751 TotalTime: 1666 TotalTime: 1813 After boot native PSS: 167089 kB: Native Bug: 18054905 Bug: 16828525 Bug: 17808975 (cherry picked from commit b6e292bf7eac9d73c6b79b1e9b7b87beb02436c9) Change-Id: Ie367f3222f8c4db409ec49c3845276908b51e9c9
Diffstat (limited to 'runtime/gc_root.h')
-rw-r--r--runtime/gc_root.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/gc_root.h b/runtime/gc_root.h
index b10a55c1a2..a347622112 100644
--- a/runtime/gc_root.h
+++ b/runtime/gc_root.h
@@ -30,7 +30,9 @@ class PACKED(4) GcRoot {
ALWAYS_INLINE MirrorType* Read() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
void VisitRoot(RootCallback* callback, void* arg, uint32_t thread_id, RootType root_type) {
+ DCHECK(!IsNull());
callback(reinterpret_cast<mirror::Object**>(&root_), arg, thread_id, root_type);
+ DCHECK(!IsNull());
}
// This is only used by IrtIterator.