summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2013-02-22 09:40:58 -0800
committerIan Rogers <irogers@google.com>2013-02-22 09:40:58 -0800
commitafc10e174d73363185f42cb67ec429a64549f2c7 (patch)
tree4424b624778bfaab41d73486ec088fa048bcdaf0
parent49999acb049e09f99135e412cbb10d7367d2d607 (diff)
downloadframeworks_base-afc10e174d73363185f42cb67ec429a64549f2c7.zip
frameworks_base-afc10e174d73363185f42cb67ec429a64549f2c7.tar.gz
frameworks_base-afc10e174d73363185f42cb67ec429a64549f2c7.tar.bz2
Account malloc mmaped pages as native heap.
Currently when malloc uses a page rather than brk the heap gets accounted as ashmem memory. Previously the memory would be accounted as unknown but since [1] it gets accounted as ashmem. This change makes the accounting see this memory as being native, ie the same kind of memory we associate with brk. [1] https://android-review.googlesource.com/#/c/49583/3 Change-Id: I6f496cfeb590268d41d8e047b12cd5c90359e2b0
-rw-r--r--core/jni/android_os_Debug.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index 6724f36..56b687c 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -159,7 +159,8 @@ static void read_mapinfo(FILE *fp, stats_t* stats)
name = line + name_pos;
nameLen = strlen(name);
- if (strstr(name, "[heap]") == name) {
+ if ((strstr(name, "[heap]") == name) ||
+ (strstr(name, "/dev/ashmem/libc malloc") == name)) {
whichHeap = HEAP_NATIVE;
} else if (strstr(name, "/dev/ashmem/dalvik-") == name) {
whichHeap = HEAP_DALVIK;