diff options
| author | showp1984 <showp1984@gmail.com> | 2012-01-25 02:56:34 -0800 |
|---|---|---|
| committer | Steve Kondik <shade@chemlab.org> | 2013-07-24 12:55:56 -0700 |
| commit | 7970603ca63dfc560789ca4b4723a0bfa6de6c8e (patch) | |
| tree | df798cd81bf473af06b0c9098f66c9f0b97337f1 /vm/compiler/codegen/arm/GlobalOptimizations.cpp | |
| parent | 3805305a785f1ab68bf19aefb77a4d8d224e254b (diff) | |
[PATCH] Basic KSM Support
Be sure to add '#define MADV_MERGEABLE 12' to
bionic/libc/include/sys/mman.h so we can have a central place for this
parse the process memory map and inform madvise common HEAP/Stack
regions on fork from zygote
These then can be used by the kernel KSM module to re-join (copy on write)
pages between the various dalvik processes.
As is on a fully loaded system you can expect ~12MB to be indicated to be
scanned by KSM.. of this 10-15% will be saved; as such a recommend a very
slow scan until as any logic to stop scanning while sleeping will require
another process and remove all memory savings provided by this logic.
To activate on a KSM kernel (2min for full scan of ~16m and 1%CPU):
echo 4000 > /sys/kernel/mm/ksm/sleep_millisecs
echo 128 > /sys/kernel/mm/ksm/pages_to_scan
echo 1 > /sys/kernel/mm/ksm/run
Newer kernels only require the last line.
In future additional memory regions and kernel logic may improve this.
Change-Id: I271cbee74a1f02a89c34c6ee9006a4ea81360154
Diffstat (limited to 'vm/compiler/codegen/arm/GlobalOptimizations.cpp')
0 files changed, 0 insertions, 0 deletions
