Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 472401fb42abaeae2ae0b2eec52d465f80643dde
      
https://github.com/WebKit/WebKit/commit/472401fb42abaeae2ae0b2eec52d465f80643dde
  Author: Ben Nham <[email protected]>
  Date:   2026-10-06 (Tue, 06 Oct 2026)

  Changed paths:
    M Source/WTF/wtf/PlatformEnableCocoa.h
    M Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
    M Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm
    M Source/WebKit/UIProcess/MemoryFootprintMonitor.cpp
    M Source/WebKit/UIProcess/MemoryFootprintMonitor.h
    M Source/WebKit/UIProcess/WebProcessProxy.h
    M Source/WebKit/UIProcess/WebProcessProxy.messages.in
    M Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

  Log Message:
  -----------
  MemoryFootprintMonitor should enforce task limit on devices without 
WebContent jetsam limit
https://bugs.webkit.org/show_bug.cgi?id=326117
rdar://problem/189031806

Reviewed by Per Arne Vollan.

On iOS, MemoryFootprintMonitor enforces a limit matching the per-process 
WebContent jetsam
limit. Some devices don't have WebContent-specific jetsam limits and instead 
just give WebContent
the global Mach task limit.

There isn't a syscall we can use to figure out if WebContent is jetsam-limited, 
but we can use a
heuristic which works for all current devices. The heuristic is for WebContent 
to send its jetsam
limit to UIProcess at init time. If the limit is large (greater than 3 GB), 
then WebContent is
likely not jetsam limited. In that case, we tell MemoryFootprintMonitor to 
limit pages to the task
limit rather than the jetsam limit.

* Source/WTF/wtf/PlatformEnableCocoa.h:
* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize):
* Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::didComputeAvailableMemory):
* Source/WebKit/UIProcess/MemoryFootprintMonitor.cpp:
(WebKit::configurationWithLimit):
(WebKit::jetsamLimitedConfiguration):
(WebKit::taskLimitedConfiguration):
(WebKit::MemoryFootprintMonitor::defaultConfiguration):
(WebKit::MemoryFootprintMonitor::setConfiguration):
(WebKit::MemoryFootprintMonitor::setConfigurationForTesting):
(WebKit::MemoryFootprintMonitor::didDetectWebProcessWithoutPerProcessJetsamLimit):
* Source/WebKit/UIProcess/MemoryFootprintMonitor.h:
* Source/WebKit/UIProcess/WebProcessProxy.h:
* Source/WebKit/UIProcess/WebProcessProxy.messages.in:
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::accessibilityFocusedUIElement):

Canonical link: https://commits.webkit.org/322890@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to