OSDN Git Service

Tune rosalloc buffer sizes.
authorHiroshi Yamauchi <yamauchi@google.com>
Thu, 20 Nov 2014 18:08:31 +0000 (10:08 -0800)
committerHiroshi Yamauchi <yamauchi@google.com>
Thu, 20 Nov 2014 21:21:35 +0000 (13:21 -0800)
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.

Bug: 18377775

Change-Id: Ie1bb46bcf5d3729197e48e26a27da4cc39dd807e

runtime/gc/allocator/rosalloc.cc
runtime/gc/allocator/rosalloc.h

index ad22a2e..7e88c41 100644 (file)
@@ -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) {
index b2a5a3c..5daac92 100644 (file)
@@ -403,7 +403,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.