Add low memory mode option.
Added a low memory mode option which can be enabled by passing the
flag "-XX:LowMemoryMode" to the VM.
Changed dvmHeapSourceAlloc to use mspace_malloc and madvise page
aligned regions of allocations back to the kernel if low
memory mode is enabled. No measurable performance penalty on a
benchmark which does 4 million object allocations. This seems to
reduce the Dalvik total PSS by 10 - 15% on devices with
large bitmaps (such as manta or flo).
Another change is that cards are madvised instead of memset when
cleared if low memory mode is enabled. This saves a minor amount
of memory at the cost of having slightly more page faults.
Change-Id: I0c850bc370ebabf4393bff1c47d3257b2f1518d2
5 files changed