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
This commit is contained in:
Tim Murray
2018-10-15 16:29:15 -07:00
parent 13d2b5f1ab
commit 64fee6148b

View File

@@ -223,6 +223,7 @@ Bitmap::~Bitmap() {
break; break;
case PixelStorageType::Heap: case PixelStorageType::Heap:
free(mPixelStorage.heap.address); free(mPixelStorage.heap.address);
mallopt(M_PURGE, 0);
break; break;
case PixelStorageType::Hardware: case PixelStorageType::Hardware:
auto buffer = mPixelStorage.hardware.buffer; auto buffer = mPixelStorage.hardware.buffer;