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
diff --git a/libs/hwui/hwui/Bitmap.cpp b/libs/hwui/hwui/Bitmap.cpp
index 263d249..e7ffbee 100644
--- a/libs/hwui/hwui/Bitmap.cpp
+++ b/libs/hwui/hwui/Bitmap.cpp
@@ -223,6 +223,7 @@
break;
case PixelStorageType::Heap:
free(mPixelStorage.heap.address);
+ mallopt(M_PURGE, 0);
break;
case PixelStorageType::Hardware:
auto buffer = mPixelStorage.hardware.buffer;