Title: [292315] trunk/Source/_javascript_Core
Revision
292315
Author
gga...@apple.com
Date
2022-04-04 13:54:01 -0700 (Mon, 04 Apr 2022)

Log Message

Only check isPagedOut() under memory pressure
https://bugs.webkit.org/show_bug.cgi?id=238742

Reviewed by Cameron McCormack.

Worth about 0.4% on Speedometer.

In theory, if we're not under memory pressure, we're either (a) not
paged out because we were not recently under memory pressure or (b)
paged out but OK to page in again because memory is available.

This could increase swap if a system frequently oscillated between
yes-memory-pressure and no-memory-pressure; but in practice the systems
we see under significant memory pressure tend to stay that way.

* heap/FullGCActivityCallback.cpp:
(JSC::FullGCActivityCallback::doCollection):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (292314 => 292315)


--- trunk/Source/_javascript_Core/ChangeLog	2022-04-04 20:41:32 UTC (rev 292314)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-04-04 20:54:01 UTC (rev 292315)
@@ -1,3 +1,23 @@
+2022-04-04  Geoffrey Garen  <gga...@apple.com>
+
+        Only check isPagedOut() under memory pressure
+        https://bugs.webkit.org/show_bug.cgi?id=238742
+
+        Reviewed by Cameron McCormack.
+
+        Worth about 0.4% on Speedometer.
+
+        In theory, if we're not under memory pressure, we're either (a) not
+        paged out because we were not recently under memory pressure or (b)
+        paged out but OK to page in again because memory is available.
+
+        This could increase swap if a system frequently oscillated between
+        yes-memory-pressure and no-memory-pressure; but in practice the systems
+        we see under significant memory pressure tend to stay that way.
+
+        * heap/FullGCActivityCallback.cpp:
+        (JSC::FullGCActivityCallback::doCollection):
+
 2022-04-02  Chris Dumez  <cdu...@apple.com>
 
         Add default constructor to ASCIILiteral

Modified: trunk/Source/_javascript_Core/heap/FullGCActivityCallback.cpp (292314 => 292315)


--- trunk/Source/_javascript_Core/heap/FullGCActivityCallback.cpp	2022-04-04 20:41:32 UTC (rev 292314)
+++ trunk/Source/_javascript_Core/heap/FullGCActivityCallback.cpp	2022-04-04 20:54:01 UTC (rev 292315)
@@ -25,6 +25,7 @@
 
 #include "config.h"
 #include "FullGCActivityCallback.h"
+#include <wtf/MemoryPressureHandler.h>
 
 #include "VM.h"
 
@@ -42,7 +43,7 @@
 
 #if !PLATFORM(IOS_FAMILY) || PLATFORM(MACCATALYST)
     MonotonicTime startTime = MonotonicTime::now();
-    if (heap.isPagedOut()) {
+    if (MemoryPressureHandler::singleton().isUnderMemoryPressure() && heap.isPagedOut()) {
         cancel();
         heap.increaseLastFullGCLength(MonotonicTime::now() - startTime);
         return;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to