Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afc10e17 authored by Ian Rogers's avatar Ian Rogers
Browse files

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
parent 49999acb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;