File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,8 +53,13 @@ namespace WTF {
5353// we wait longer to try again (s_maximumHoldOffTime).
5454// These value seems reasonable and testing verifies that it throttles frequent
5555// low memory events, greatly reducing CPU usage.
56+ #if PLATFORM(WPE)
57+ static const Seconds s_minimumHoldOffTime { 1_s };
58+ static const Seconds s_maximumHoldOffTime { 1_s };
59+ #else
5660static const Seconds s_minimumHoldOffTime { 5_s };
5761static const Seconds s_maximumHoldOffTime { 30_s };
62+ #endif
5863static const size_t s_minimumBytesFreedToUseMinimumHoldOffTime = 1 * MB;
5964static const unsigned s_holdOffMultiplier = 20 ;
6065
@@ -69,7 +74,9 @@ void MemoryPressureHandler::triggerMemoryPressureEvent(bool isCritical)
6974 setMemoryPressureStatus (MemoryPressureStatus::SystemCritical);
7075
7176 ensureOnMainThread ([this , isCritical] {
72- respondToMemoryPressure (isCritical ? Critical::Yes : Critical::No);
77+ // When memory usage reaches the critical state, we may not release enough memory in time if we use the
78+ // async mode, so use synchrounous mode in such case
79+ respondToMemoryPressure (isCritical ? Critical::Yes : Critical::No, isCritical ? Synchronous::Yes : Synchronous::No);
7380 });
7481
7582 if (ReliefLogger::loggingEnabled () && isUnderMemoryPressure ())
Original file line number Diff line number Diff line change @@ -48,8 +48,13 @@ static const Seconds s_minPollingInterval { 1_s };
4848static const Seconds s_maxPollingInterval { 5_s };
4949static const double s_minUsedMemoryPercentageForPolling = 50 ;
5050static const double s_maxUsedMemoryPercentageForPolling = 85 ;
51+ #if PLATFORM(WPE)
52+ static const int s_memoryPresurePercentageThreshold = 80 ;
53+ static const int s_memoryPresurePercentageThresholdCritical = 85 ;
54+ #else
5155static const int s_memoryPresurePercentageThreshold = 90 ;
5256static const int s_memoryPresurePercentageThresholdCritical = 95 ;
57+ #endif
5358// cgroups.7: The usual place for such mounts is under a tmpfs(5)
5459// filesystem mounted at /sys/fs/cgroup.
5560static const char * s_cgroupMemoryPath = " /sys/fs/cgroup/%s/%s/%s" ;
You can’t perform that action at this time.
0 commit comments