summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorHui Yu <huiyu@google.com>2018-07-23 17:59:59 -0700
committerHui Yu <huiyu@google.com>2018-08-03 19:08:37 -0700
commit8e88e955a6b55bac63eb3d60c794ca0cf7c07c0c (patch)
tree43813a28ce5217685ed8df51fed63cc58032436e /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parentaaaedf21d53e212cea87869a8d1842fa6f43ed91 (diff)
Fix memory leak in TimeBase.mObservers list.
Leaks happen in following places: 1. Not all timer/counter in Uid class are detached from TimeBase when the Uid object is destructed. 2. When Uid object is removed from mUidStats list in onUserRemovedLocked, removeUidStatsLocked, readLocked, All timer/counter in Uid class are not detached from TimeBase. 3. When timer/counter in Uid class is reassigned, the previous timer/counter object is not detached. Performance improvement: The mObservers list in TimeBase object of BatteryStatsImpl can have size up like 20k, the list type is ArrayList, remove() method on ArrayList is very slow. For long mObservers list, we change to use HashSet as container. The mObservers list in TimeBase object of Uid is short, it continues to use ArrayList as container. Fix: 80443940 Test: "adb shell cmd battery unplug" and "adb shell cmd battery set ac 1", observe memory usage from Android Monitor. Change-Id: I2001ca390a0a86a32082e1012dde4b831f1e7d04
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions