Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Unified Diff: src/heap.h

Issue 236063015: Grow old generation slower on low-memory devices. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index 1f7526e71a58e146706c9b6922ab40c25164e457..dee91b9409e601be80212f736b88bf02f2db851f 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1518,9 +1518,30 @@ class Heap {
static const intptr_t kMinimumOldGenerationAllocationLimit =
8 * (Page::kPageSize > MB ? Page::kPageSize : MB);
+ static const int kLumpOfMemory = (i::kPointerSize / 4) * i::MB;
+
+ // The new space size has to be a power of 2.
+ static const int kMaxNewSpaceSizeLowMemoryDevice = 2 * kLumpOfMemory;
+ static const int kMaxNewSpaceSizeMediumMemoryDevice = 8 * kLumpOfMemory;
+ static const int kMaxNewSpaceSizeHighMemoryDevice = 16 * kLumpOfMemory;
+ static const int kMaxNewSpaceSizeHugeMemoryDevice = 16 * kLumpOfMemory;
+
+ // The old space size has to be a multiple of Page::kPageSize.
+ static const int kMaxOldSpaceSizeLowMemoryDevice = 128 * kLumpOfMemory;
+ static const int kMaxOldSpaceSizeMediumMemoryDevice = 256 * kLumpOfMemory;
+ static const int kMaxOldSpaceSizeHighMemoryDevice = 512 * kLumpOfMemory;
+ static const int kMaxOldSpaceSizeHugeMemoryDevice = 700 * kLumpOfMemory;
+
+ // The executable size has to be a multiple of Page::kPageSize.
+ static const int kMaxExecutableSizeLowMemoryDevice = 128 * kLumpOfMemory;
+ static const int kMaxExecutableSizeMediumMemoryDevice = 256 * kLumpOfMemory;
+ static const int kMaxExecutableSizeHighMemoryDevice = 512 * kLumpOfMemory;
+ static const int kMaxExecutableSizeHugeMemoryDevice = 700 * kLumpOfMemory;
+
intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) {
- intptr_t limit = FLAG_stress_compaction ?
- old_gen_size + old_gen_size / 10 : old_gen_size * 4;
+ intptr_t limit = FLAG_stress_compaction
+ ? old_gen_size + old_gen_size / 10
+ : old_gen_size * old_space_growing_factor_;
limit = Max(limit, kMinimumOldGenerationAllocationLimit);
limit += new_space_.Capacity();
intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
@@ -1886,6 +1907,11 @@ class Heap {
intptr_t max_executable_size_;
intptr_t maximum_committed_;
+ // The old space growing factor is used in the old space heap growing
+ // strategy. The new old space size is the current old space size times
+ // old_space_growing_factor_.
+ int old_space_growing_factor_;
+
// For keeping track of how much data has survived
// scavenge since last new space expansion.
int survived_since_last_expansion_;
« no previous file with comments | « src/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698