From ab3576e58a8d3965f57473e03ec8de69ae13404b Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Fri, 22 May 2015 09:16:45 +0200 Subject: [PATCH] Don't count lowmem mappings as memory used. Bug: 21268095 Change-Id: I1b5f42752752584e947af710e53896203fbe477c --- core/jni/android_os_Debug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp index 2692ad82c70b6..e8acd97800873 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -580,8 +580,8 @@ static long get_allocated_vmalloc_memory() { break; } - if (!strstr(line, "ioremap")) { - // Ignore ioremap regions, since they don't actually consume memory + if (!strstr(line, "ioremap") && !strstr(line, "map_lowmem")) { + // Ignore ioremap and map_lowmem regions, since they don't actually consume memory if (sscanf(line, "%*x-%*x %ld", &size) == 1) { vmalloc_allocated_size += size; }