Title: [269808] trunk/Source/WebKit
Revision
269808
Author
[email protected]
Date
2020-11-13 17:09:38 -0800 (Fri, 13 Nov 2020)

Log Message

[GPUProcess] Add basic low memory handling in the GPUProcess
https://bugs.webkit.org/show_bug.cgi?id=218926
<rdar://problem/70300888>

Reviewed by Geoffrey Garen.

Add basic low memory handling in the GPUProcess. For now, the GPUProcess only calls
WTF::releaseFastMallocFreeMemory() on low memory warning.

* GPUProcess/GPUProcess.cpp:
(WebKit::GPUProcess::initializeGPUProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (269807 => 269808)


--- trunk/Source/WebKit/ChangeLog	2020-11-14 00:55:05 UTC (rev 269807)
+++ trunk/Source/WebKit/ChangeLog	2020-11-14 01:09:38 UTC (rev 269808)
@@ -1,3 +1,17 @@
+2020-11-13  Chris Dumez  <[email protected]>
+
+        [GPUProcess] Add basic low memory handling in the GPUProcess
+        https://bugs.webkit.org/show_bug.cgi?id=218926
+        <rdar://problem/70300888>
+
+        Reviewed by Geoffrey Garen.
+
+        Add basic low memory handling in the GPUProcess. For now, the GPUProcess only calls
+        WTF::releaseFastMallocFreeMemory() on low memory warning.
+
+        * GPUProcess/GPUProcess.cpp:
+        (WebKit::GPUProcess::initializeGPUProcess):
+
 2020-11-13  Kate Cheney  <[email protected]>
 
         Can't login to Microsoft Teams

Modified: trunk/Source/WebKit/GPUProcess/GPUProcess.cpp (269807 => 269808)


--- trunk/Source/WebKit/GPUProcess/GPUProcess.cpp	2020-11-14 00:55:05 UTC (rev 269807)
+++ trunk/Source/WebKit/GPUProcess/GPUProcess.cpp	2020-11-14 01:09:38 UTC (rev 269808)
@@ -45,6 +45,7 @@
 #include <WebCore/RuntimeApplicationChecks.h>
 #include <wtf/Algorithms.h>
 #include <wtf/CallbackAggregator.h>
+#include <wtf/MemoryPressureHandler.h>
 #include <wtf/OptionSet.h>
 #include <wtf/ProcessPrivilege.h>
 #include <wtf/RunLoop.h>
@@ -128,6 +129,12 @@
     WTF::Thread::setCurrentThreadIsUserInitiated();
     AtomString::init();
 
+    auto& memoryPressureHandler = MemoryPressureHandler::singleton();
+    memoryPressureHandler.setLowMemoryHandler([this] (Critical critical, Synchronous) {
+        lowMemoryHandler(critical);
+    });
+    memoryPressureHandler.install();
+
 #if PLATFORM(IOS_FAMILY) || ENABLE(ROUTING_ARBITRATION)
     DeprecatedGlobalSettings::setShouldManageAudioSessionCategory(true);
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to