File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change 8787#include < algorithm>
8888#include < wtf/CryptographicallyRandomNumber.h>
8989#include < wtf/ListDump.h>
90+ #include < wtf/MemoryPressureHandler.h>
9091#include < wtf/RAMSize.h>
9192#include < wtf/Scope.h>
9293#include < wtf/SimpleStats.h>
@@ -678,6 +679,7 @@ bool Heap::overCriticalMemoryThreshold(MemoryThresholdCallType memoryThresholdCa
678679#if USE(BMALLOC_MEMORY_FOOTPRINT_API)
679680 if (memoryThresholdCallType == MemoryThresholdCallType::Direct || ++m_percentAvailableMemoryCachedCallCount >= 100 ) {
680681 m_overCriticalMemoryThreshold = bmalloc::api::percentAvailableMemoryInUse () > Options::criticalGCMemoryThreshold ();
682+ m_overCriticalMemoryThreshold |= bmalloc::api::memoryFootprint () > MemoryPressureHandler::singleton ().criticalMemoryThreshold ();
681683 m_percentAvailableMemoryCachedCallCount = 0 ;
682684 }
683685
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ class MemoryPressureHandler {
140140
141141 void setMemoryPressureStatus (SystemMemoryPressureStatus);
142142 SystemMemoryPressureStatus memoryPressureStatus () const { return m_memoryPressureStatus; }
143+ double criticalMemoryThreshold () const { return m_configuration.baseThreshold * m_configuration.strictThresholdFraction ; }
143144
144145 WTF_EXPORT_PRIVATE MemoryUsagePolicy currentMemoryUsagePolicy ();
145146
You can’t perform that action at this time.
0 commit comments