aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2019-12-04 15:57:07 -0800
committerChristopher Ferris <cferris@google.com>2019-12-05 15:46:22 -0800
commit5a3c920051d8139a4c81f8804d3a7be94d150e85 (patch)
treeddc7e20ab5777563640dc3b9b83939a6c871a27f /docs
parent1752b5b9c0f2ae3845278e72d7ac9f83e33f0e32 (diff)
downloadbionic-5a3c920051d8139a4c81f8804d3a7be94d150e85.tar.gz
Add mallopt M_PURGE benchmark.
Update the native allocator documentation to include running of this benchmark. Move the malloc_benchmark.cpp to malloc_sql_benchmark.cpp and use malloc_benchmark.cpp for benchmarking functions from malloc.h. Bug: 137795072 Test: Ran new benchmark. Change-Id: I76856de833032da324ad0bc0b6bd85a4ea8c253d
Diffstat (limited to 'docs')
-rw-r--r--docs/native_allocator.md14
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/native_allocator.md b/docs/native_allocator.md
index 249b1448c..139d664d9 100644
--- a/docs/native_allocator.md
+++ b/docs/native_allocator.md
@@ -160,7 +160,7 @@ Which will lock the benchmark to only run on core XX. This also avoids
any issue related to the code migrating from one core to another
with different characteristics. For example, on a big-little cpu, if the
benchmark moves from big to little or vice-versa, this can cause scores
-to fluctuate in indeterminte ways.
+to fluctuate in indeterminate ways.
For most runs, the best set of options to add is:
@@ -278,6 +278,18 @@ To run the benchmark, use these commands:
Calls to mallinfo are used in ART so a new allocator is required to be
nearly as performant as the current allocator.
+#### mallopt M\_PURGE Benchmark
+This benchmark tracks the cost of calling `mallopt(M_PURGE, 0)`. As with the
+mallinfo benchmark, it's not necessary for this to be better than the previous
+allocator, only that the performance be in the same order of magnitude.
+
+To run the benchmark, use these commands:
+
+ adb shell /data/benchmarktest64/bionic-benchmarks/bionic-benchmarks --benchmark_filter=BM_mallopt_purge
+ adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks --benchmark_filter=BM_mallopt_purge
+
+These calls are used to free unused memory pages back to the kernel.
+
### Memory Trace Benchmarks
These benchmarks measure all three axes of a native allocator, RSS, virtual
address space consumed, speed of allocation. They are designed to