Index: src/heap/heap.h |
diff --git a/src/heap/heap.h b/src/heap/heap.h |
index 6e5d788bd1d3644b0d0deb13a8f117ab63c91c42..26879c620404ceb6d71c226f879255b9e62795af 100644 |
--- a/src/heap/heap.h |
+++ b/src/heap/heap.h |
@@ -950,6 +950,23 @@ class Heap { |
return memory_pressure_level_.Value() != MemoryPressureLevel::kNone; |
} |
+ void IncreaseHeapLimitForDebugging() { |
+ const size_t kDebugHeapSizeFactor = 4; |
+ size_t max_limit = std::numeric_limits<size_t>::max() / 4; |
+ max_old_generation_size_ = |
+ Max(max_old_generation_size_, |
+ Min(max_limit, |
+ initial_max_old_generation_size_ * kDebugHeapSizeFactor)); |
+ } |
+ |
+ void RestoreOriginalHeapLimit() { |
+ // Do not set the limit lower than the live size + some slack. |
+ size_t min_limit = SizeOfObjects() + SizeOfObjects() / 4; |
+ max_old_generation_size_ = |
+ Min(max_old_generation_size_, |
+ Max(initial_max_old_generation_size_, min_limit)); |
+ } |
+ |
// =========================================================================== |
// Initialization. =========================================================== |
// =========================================================================== |
@@ -2131,6 +2148,7 @@ class Heap { |
size_t max_semi_space_size_; |
size_t initial_semispace_size_; |
size_t max_old_generation_size_; |
+ size_t initial_max_old_generation_size_; |
size_t initial_old_generation_size_; |
bool old_generation_size_configured_; |
size_t max_executable_size_; |