Skip to content

Commit 3e1cba2

Browse files
heycamaperezdc
authored andcommitted
Make memory pressure handler call deleteAllCode with PreventCollectionAndDeleteAllCode https://bugs.webkit.org/show_bug.cgi?id=253133 <rdar://problem/106065668> Reviewed by Mark Lam and Yusuke Suzuki. The memory pressure handler currently calls GCController::deleteAllCode(DeleteAllCodeIfNotCollecting), but it turns out we hit the case of a collection being in progress moderately often. We already do a bunch of blocky work here to get memory usage down, so let's change this to PreventCollectionAndDeleteAllCode to guarantee we can drop all JIT code. * Source/WebCore/page/MemoryRelease.cpp: (WebCore::releaseCriticalMemory): Canonical link: https://commits.webkit.org/261061@main
1 parent 8fec696 commit 3e1cba2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Source/WebCore/page/MemoryRelease.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ static void releaseCriticalMemory(Synchronous synchronous, MaintainBackForwardCa
113113
document->cachedResourceLoader().garbageCollectDocumentResources();
114114
}
115115

116-
GCController::singleton().deleteAllCode(JSC::DeleteAllCodeIfNotCollecting);
116+
if (synchronous == Synchronous::Yes)
117+
GCController::singleton().deleteAllCode(JSC::PreventCollectionAndDeleteAllCode);
118+
else
119+
GCController::singleton().deleteAllCode(JSC::DeleteAllCodeIfNotCollecting);
117120

118121
#if ENABLE(VIDEO)
119122
for (auto* mediaElement : HTMLMediaElement::allMediaElements()) {

0 commit comments

Comments
 (0)