From f6a63ae3a7004a8eca87fca5a66cfb6aef4e86b5 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Wed, 22 Jun 2011 15:13:09 -0700 Subject: [PATCH 1/2] Fix memory leak in OpenGLRenderer. When creating a display list, matrices are duplicated locally. They were however never deleted, thus causing apps to slowly leak memory (a matrix is about 40 bytes.) Change-Id: Iac465b720d4c4c9b5ca3fce870c0c912c14a74ab --- libs/hwui/DisplayListRenderer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h index dcf2cf2ddb39c..98c341f08a884 100644 --- a/libs/hwui/DisplayListRenderer.h +++ b/libs/hwui/DisplayListRenderer.h @@ -419,7 +419,9 @@ private: inline void addMatrix(SkMatrix* matrix) { // Copying the matrix is cheap and prevents against the user changing the original // matrix before the operation that uses it - addInt((int) new SkMatrix(*matrix)); + SkMatrix* copy = new SkMatrix(*matrix); + addInt((int) copy); + mMatrices.add(copy); } inline void addBitmap(SkBitmap* bitmap) { From 83c033de06cd2af243ecf8e2c4b87cd2de2b786e Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Wed, 22 Jun 2011 16:12:41 -0700 Subject: [PATCH 2/2] Change max heap size to 48MB Change-Id: I00b547960c07f1cbe753c3a1391fd3840bd70ea3 --- build/phone-hdpi-512-dalvik-heap.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/phone-hdpi-512-dalvik-heap.mk b/build/phone-hdpi-512-dalvik-heap.mk index 788b686096048..16e05055e0309 100644 --- a/build/phone-hdpi-512-dalvik-heap.mk +++ b/build/phone-hdpi-512-dalvik-heap.mk @@ -19,5 +19,5 @@ PRODUCT_PROPERTY_OVERRIDES += \ dalvik.vm.heapstartsize=5m \ - dalvik.vm.heapgrowthlimit=32m \ + dalvik.vm.heapgrowthlimit=48m \ dalvik.vm.heapsize=128m