Index: src/heap/heap.h |
diff --git a/src/heap/heap.h b/src/heap/heap.h |
index 6e5d788bd1d3644b0d0deb13a8f117ab63c91c42..303895de816316d14ca71d96b0c9a4ed4637abfb 100644 |
--- a/src/heap/heap.h |
+++ b/src/heap/heap.h |
@@ -950,6 +950,22 @@ 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, max_old_generation_size_ * kDebugHeapSizeFactor)); |
Hannes Payer (out of office)
2016/12/22 11:50:29
Isn't the requirement on 32-bit to stay within 2G
ulan
2016/12/22 14:04:51
Yes, max_limit is 1GB on 32-bit.
|
+ } |
+ |
+ void RestoreOriginalHeapLimit() { |
+ // Do not set the limit lower than the live size + some slack. |
+ size_t min_limit = SizeOfObjects() + SizeOfObjects() / 4; |
Hannes Payer (out of office)
2016/12/22 11:50:29
If the restoring of the initial max_old_generation
ulan
2016/12/22 14:04:51
Yep, we have no choice there. It is probably ok, b
Hannes Payer (out of office)
2016/12/23 07:49:56
We could try to set it at the end of a full gc and
ulan
2016/12/27 12:41:35
It makes sense as mitigation, but there is no guar
|
+ max_old_generation_size_ = |
+ Min(max_old_generation_size_, |
+ Max(initial_max_old_generation_size_, min_limit)); |
+ } |
+ |
// =========================================================================== |
// Initialization. =========================================================== |
// =========================================================================== |
@@ -2131,6 +2147,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_; |