diff options
author | Johannes Carlsson <johannes.carlsson.x@sonyericsson.com> | 2010-10-27 08:28:14 +0200 |
---|---|---|
committer | Johan Redestig <johan.redestig@sonyericsson.com> | 2010-10-27 08:28:14 +0200 |
commit | 3ffccab78666d8960c10a00239de6bb40f4fb1b6 (patch) | |
tree | 6a2cd75ef5f10f1973f961c864db9e8130e5cd62 /telephony | |
parent | b4ae2f1ba419212224d53db81c46ad242bebd17b (diff) | |
download | frameworks_base-3ffccab78666d8960c10a00239de6bb40f4fb1b6.zip frameworks_base-3ffccab78666d8960c10a00239de6bb40f4fb1b6.tar.gz frameworks_base-3ffccab78666d8960c10a00239de6bb40f4fb1b6.tar.bz2 |
Release reference when putting RILRequest back into the pool.
In order to reduce object creation the RILRequest objects are
stored in an array when it is unused (max 4). This avoids GC
of the object. The object in turn has references to other
objects which sometimes hold large memory chunks. This fix
releases these references since they are not used anyway.
This will make it possible to GC the Message (mResult) which
in some cases holds references to a Bitmap which sometimes
leads to OutOfMemoryException. The reference is cleared
anyway in RILRequest.obtain(...)
Change-Id: I3b895bc39b5e2f3ab7cc8297c3583ea78e0ebc77
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/RIL.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index a9a4be2..2f7aa21 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -141,6 +141,7 @@ class RILRequest { this.mNext = sPool; sPool = this; sPoolSize++; + mResult = null; } } } |