Android 5.1.1 release 1
Tune the jemalloc to reign in PSS.

The tcache in jemalloc can take up quite a bit of extra PSS. Disabling
the tcache can save a lot of PSS, but it radically reduces performance.

Tune the number of small and large values to store in the tcache.
Immediately force any dirty pages to be purged, rather than keep some
number of dirty pages around.

Restore the chunk size back to 4MB. Using this chunk size and the force
dirty page results in a higher cf-bench native mallocs score but about
the same amount of PSS use.

Limit the number of arenas to 2. The default is 2 * number of cpus, but
that increases the amount of PSS used. My benchmarking indicates that
more than 2 really doesn't help too much even on a device with 4 cpus.
Nearly all speed-ups come from the tcache.

Bug: 17498287

Change-Id: I23b23dd88288c90e002a0a04684fb06dbf4ee742
5 files changed