Use smaller rosalloc run sizes.
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.
(cherrypick commit c867a275aa7a132ec1fd4f3b8c27812bda61ea73)
Bug: 27744947
Bug: 9986565
Change-Id: I8ac3fd23719e5cfcce7e5715a03f40701f3ff339
diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc
index 2c487fe..2a55a43 100644
--- a/runtime/gc/allocator/rosalloc.cc
+++ b/runtime/gc/allocator/rosalloc.cc
@@ -1653,14 +1653,14 @@
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];