[Webkit-unassigned] [Bug 251134] linux memory pressure for swap memory

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 24 21:54:07 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=251134

--- Comment #1 from Donghwa Kim <donghwa at altimedia.com> ---
This is my suggetion :

diff --git a/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp b/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp
index fb86ee9d996d..674ff297837c 100644
--- a/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp
+++ b/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp
@@ -248,13 +248,14 @@ MemoryPressureHandler::MemoryUsagePoller::MemoryUsagePoller()
             bool critical = false;
             bool synchronous = false;
             size_t value = 0;
+            size_t value_swap = 0;

             if (s_pollMaximumProcessMemoryCriticalLimit) {
-                if (readToken(s_processStatus, "VmRSS:", KB, value)) {
-                    if (value > s_pollMaximumProcessMemoryNonCriticalLimit) {
+                if (readToken(s_processStatus, "VmRSS:", KB, value) && readToken(s_processStatus, "VmSwap:", KB, value_swap)) {
+                    if (value + value_swap > s_pollMaximumProcessMemoryNonCriticalLimit) {
                         underMemoryPressure = true;
-                        critical = value > s_pollMaximumProcessMemoryCriticalLimit;
-                        synchronous = value > s_pollMaximumProcessMemoryCriticalLimit * 1.05;
+                        critical = value + value_swap > s_pollMaximumProcessMemoryCriticalLimit;
+                        synchronous = value + value_swap > s_pollMaximumProcessMemoryCriticalLimit * 1.05;
                     }
                 }
             }

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230125/f8c89ebf/attachment.htm>


More information about the webkit-unassigned mailing list