Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index b3b24930e2d4329da1431ee842d0237be151705d..84681000d39eac5a3069208ccf2123349aa7aa8b 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -4372,6 +4372,13 @@ class MemoryPressureInterruptTask : public CancelableTask { |
}; |
void Heap::CheckMemoryPressure() { |
+ if (HighMemoryPressure()) { |
+ if (isolate()->concurrent_recompilation_enabled()) { |
+ // The optimizing compiler may be unnecessarily holding on to memory. |
+ DisallowHeapAllocation no_recursive_gc; |
+ isolate()->optimizing_compile_dispatcher()->Flush(); |
+ } |
+ } |
if (memory_pressure_level_.Value() == MemoryPressureLevel::kCritical) { |
CollectGarbageOnMemoryPressure("memory pressure"); |
} else if (memory_pressure_level_.Value() == MemoryPressureLevel::kModerate) { |