summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2018-10-15 16:29:15 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-10-20 00:17:47 +0000
commit7d4945ca8664c7e5def08ce4bbd6841a1bfac174 (patch)
tree5ca5b14ba5c14ab7dc2ac60c225f17b3400cb18e
parent35f31cbac405b20ec1cd55714609c88f98a99c14 (diff)
downloadbase-7d4945ca8664c7e5def08ce4bbd6841a1bfac174.tar.gz
hwui: purge malloc pages on bitmap destruction
Immediately purge malloc pages on bitmap destruction. Bitmaps are often big and can cause memory to stay high for much longer than it should. Test: boots and works bug 117795621 Merged-in: If2e8c5f1fc07039cf3dc3edcd3dc06861dbce1a1 Change-Id: If2e8c5f1fc07039cf3dc3edcd3dc06861dbce1a1 (cherry picked from commit 535fae32e597445a480896ea8e01662ada444c0c)
-rw-r--r--libs/hwui/hwui/Bitmap.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/hwui/Bitmap.cpp b/libs/hwui/hwui/Bitmap.cpp
index 263d249d20e9..c6ef090c1f76 100644
--- a/libs/hwui/hwui/Bitmap.cpp
+++ b/libs/hwui/hwui/Bitmap.cpp
@@ -223,6 +223,7 @@ Bitmap::~Bitmap() {
break;
case PixelStorageType::Heap:
free(mPixelStorage.heap.address);
+ mallopt(M_PURGE, 0);
break;
case PixelStorageType::Hardware:
auto buffer = mPixelStorage.hardware.buffer;
@@ -230,7 +231,6 @@ Bitmap::~Bitmap() {
mPixelStorage.hardware.buffer = nullptr;
break;
}
-
android::uirenderer::renderthread::RenderProxy::onBitmapDestroyed(getStableID());
}