Skip to content

Commit 92ddde7

Browse files
authored
Merge pull request #1292 from WebPlatformForEmbedded/development/memory-pressure-strict-sync
Do critical and synchronous memory release when limit is exceeded and print log message.
2 parents d0d31dc + 6d2648d commit 92ddde7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Source/WTF/wtf/MemoryPressureHandler.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@ void MemoryPressureHandler::measurementTimerFired()
303303
releaseMemory(Critical::No, Synchronous::No);
304304
break;
305305
case MemoryUsagePolicy::Strict:
306+
if (footprint > m_configuration.baseThreshold || footprintVideo > m_configuration.baseThresholdVideo) {
307+
WTFLogAlways("MemoryPressure: Critical memory usage (PID=%d) [MB]: %zu (of %zu), video: %zu (of %zu)\n",
308+
getpid(), footprint / MB, m_configuration.baseThreshold / MB,
309+
footprintVideo / MB, m_configuration.baseThresholdVideo / MB);
310+
releaseMemory(Critical::Yes, Synchronous::Yes);
311+
break;
312+
}
306313
releaseMemory(Critical::Yes, Synchronous::No);
307314
break;
308315
}

0 commit comments

Comments
 (0)