Skip to content

Commit 3ffccab

Browse files
Johannes CarlssonJohan Redestig
authored andcommitted
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
1 parent b4ae2f1 commit 3ffccab

File tree

1 file changed

+1
-0
lines changed
  • telephony/java/com/android/internal/telephony

1 file changed

+1
-0
lines changed

telephony/java/com/android/internal/telephony/RIL.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ void release() {
141141
this.mNext = sPool;
142142
sPool = this;
143143
sPoolSize++;
144+
mResult = null;
144145
}
145146
}
146147
}

0 commit comments

Comments
 (0)