OSDN Git Service

Use smaller rosalloc run sizes.
authorHiroshi Yamauchi <yamauchi@google.com>
Wed, 23 Mar 2016 17:54:59 +0000 (10:54 -0700)
committerHiroshi Yamauchi <yamauchi@google.com>
Wed, 23 Mar 2016 19:31:43 +0000 (12:31 -0700)
Use 1/1/1/2/4 instead of 1/4/8/16/32 to save memory footprint.

No regressions in BinaryTrees, Ritz MemAlocTest, Ritz EAAC.

Bug: 27744947
Bug: 9986565
Change-Id: If26dfae073df86b8c6e6b411c22e50cd808599ef

runtime/gc/allocator/rosalloc.cc

index 2c487fe..2a55a43 100644 (file)
@@ -1653,14 +1653,14 @@ void RosAlloc::Initialize() {
     if (i < kNumThreadLocalSizeBrackets) {
       numOfPages[i] = 1;
     } else if (i < (kNumThreadLocalSizeBrackets + kNumRegularSizeBrackets) / 2) {
-      numOfPages[i] = 4;
+      numOfPages[i] = 1;
     } else if (i < kNumRegularSizeBrackets) {
-      numOfPages[i] = 8;
+      numOfPages[i] = 1;
     } else if (i == kNumOfSizeBrackets - 2) {
-      numOfPages[i] = 16;
+      numOfPages[i] = 2;
     } else {
       DCHECK_EQ(i, kNumOfSizeBrackets - 1);
-      numOfPages[i] = 32;
+      numOfPages[i] = 4;
     }
     if (kTraceRosAlloc) {
       LOG(INFO) << "numOfPages[" << i << "]=" << numOfPages[i];