summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2014-11-20 14:16:06 -0800
committerHiroshi Yamauchi <yamauchi@google.com>2014-11-20 14:16:06 -0800
commit3f3c6c030db14e47d3022f00403f46240623f339 (patch)
treee1ed5312837ff53ce57279e2b30fbccb85666cfd
parent8542ff31bfa778a06316511672dc113a3f19ae5b (diff)
downloadart-3f3c6c030db14e47d3022f00403f46240623f339.zip
art-3f3c6c030db14e47d3022f00403f46240623f339.tar.gz
art-3f3c6c030db14e47d3022f00403f46240623f339.tar.bz2
Tune rosalloc buffer sizes.
We now use one-page buffers for size brackets 4-7, instead of two-page buffers, and the first 8 size brackets for thread-local allocations, instead of 11. No slowdown observed with MemAllocTest, EvaluateAndApplyChanges, and BinaryTrees. (cherrypick commit c4cd95fa37b7138a0fa26d07c235aa409542aecd) Bug: 18377775 Change-Id: I311f3adf9cab660d258833b17df7e6d905f73c72
-rw-r--r--runtime/gc/allocator/rosalloc.cc2
-rw-r--r--runtime/gc/allocator/rosalloc.h3
2 files changed, 2 insertions, 3 deletions
diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc
index 991b956..7c2474f 100644
--- a/runtime/gc/allocator/rosalloc.cc
+++ b/runtime/gc/allocator/rosalloc.cc
@@ -1772,7 +1772,7 @@ void RosAlloc::Initialize() {
if (i < 4) {
numOfPages[i] = 1;
} else if (i < 8) {
- numOfPages[i] = 2;
+ numOfPages[i] = 1;
} else if (i < 16) {
numOfPages[i] = 4;
} else if (i < 32) {
diff --git a/runtime/gc/allocator/rosalloc.h b/runtime/gc/allocator/rosalloc.h
index 431686a..3269e10 100644
--- a/runtime/gc/allocator/rosalloc.h
+++ b/runtime/gc/allocator/rosalloc.h
@@ -414,8 +414,7 @@ class RosAlloc {
// We use thread-local runs for the size Brackets whose indexes
// are less than this index. We use shared (current) runs for the rest.
-
- static const size_t kNumThreadLocalSizeBrackets = 11;
+ static const size_t kNumThreadLocalSizeBrackets = 8;
private:
// The base address of the memory region that's managed by this allocator.