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

Unified Diff: src/heap/heap.h

Issue 2919023003: [heap] Scale max heap growing factor. (Closed)
Patch Set: tests Created 3 years, 6 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 | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 92d0f45e9e505e8a0c5b9d95944fe17d1d2626ed..1e4b030e83ad681125b4fccae1bac9eae54a7c94 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -624,8 +624,8 @@ class Heap {
// The old space size has to be a multiple of Page::kPageSize.
// Sizes are in MB.
- static const int kMinOldSpaceSize = 128 * kPointerMultiplier;
- static const int kMaxOldSpaceSize = 1024 * kPointerMultiplier;
+ static const int kMinOldGenerationSize = 128 * kPointerMultiplier;
+ static const int kMaxOldGenerationSize = 1024 * kPointerMultiplier;
static const int kTraceRingBufferSize = 512;
static const int kStacktraceBufferSize = 512;
@@ -716,8 +716,11 @@ class Heap {
return "Unknown collector";
}
+ V8_EXPORT_PRIVATE static double MaxHeapGrowingFactor(
+ size_t max_old_generation_size);
V8_EXPORT_PRIVATE static double HeapGrowingFactor(double gc_speed,
- double mutator_speed);
+ double mutator_speed,
+ double max_factor);
// Copy block of memory from src to dst. Size of block should be aligned
// by pointer size.
@@ -939,16 +942,6 @@ class Heap {
bool ShouldOptimizeForMemoryUsage();
- bool IsLowMemoryDevice() {
- const int kMaxOldSpaceSizeLowMemoryDevice = 128 * kPointerMultiplier;
- return max_old_generation_size_ <= kMaxOldSpaceSizeLowMemoryDevice;
- }
-
- bool IsMemoryConstrainedDevice() {
- const int kMaxOldSpaceSizeMediumMemoryDevice = 256 * kPointerMultiplier;
- return max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice;
- }
-
bool HighMemoryPressure() {
return memory_pressure_level_.Value() != MemoryPressureLevel::kNone;
}
@@ -1349,7 +1342,8 @@ class Heap {
int computed_size =
static_cast<int>(physical_memory / i::MB /
old_space_physical_memory_factor * kPointerMultiplier);
- return Max(Min(computed_size, kMaxOldSpaceSize), kMinOldSpaceSize);
+ return Max(Min(computed_size, kMaxOldGenerationSize),
+ kMinOldGenerationSize);
}
static size_t ComputeMaxSemiSpaceSize(uint64_t physical_memory) {
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698