diff options
author | Vic Yang <victoryang@google.com> | 2019-01-23 14:21:58 -0800 |
---|---|---|
committer | Vic Yang <victoryang@google.com> | 2019-01-23 14:33:02 -0800 |
commit | dac328ad5118417a4622952ed8c62b3943612d09 (patch) | |
tree | 5cbede9caf341492d9d69c8e8eabc2d7dd52ad9e /libc/malloc_hooks/malloc_hooks.cpp | |
parent | fb78a4ac1b93218f59aa44089ae5f4dbfababf0d (diff) |
linker: Reduce number of mmap()/prctl() calls in block allocator
Given that the block allocator does not free allocated memory unless
all objects are freed, we can allocate a large chunk of memory at a
time. This gives us:
1. Higher space efficiency, especially when the objects being
allocated has a large size.
2. Much less mmap()/prctl() calls.
3. Much less vm_area_struct objects.
While this increases the size of virtual memory allocated, the number
of dirty pages would be unchanged or less.
Test result on a Go device:
- Zygote starts 24ms faster on average.
- Kernel vm_area_struct usage 138KB less, across the entire system.
Bug: 112073665
Test: Boot and check the result from 'showmap'.
Change-Id: Iece631a5081151dd1e5bf25dbddac9b264bcdcff
Diffstat (limited to 'libc/malloc_hooks/malloc_hooks.cpp')
0 files changed, 0 insertions, 0 deletions