Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
GC (almost) immediately when navigating under memory pressure.
<https://webkit.org/b/141663> Reviewed by Geoffrey Garen. Since the PageCache is already disabled in memory pressure situations, we know that detaching the old window shell on navigation is basically guaranteed to generate a bunch of garbage, we can soften the memory peak a bit by doing a GC right away instead of scheduling one for soon(tm). * bindings/js/GCController.cpp: (WebCore::GCController::GCController): (WebCore::GCController::garbageCollectSoon): (WebCore::GCController::garbageCollectOnNextRunLoop): (WebCore::GCController::gcTimerFired): * bindings/js/GCController.h: Add a GCController::garbageCollectOnNextRunLoop() complement to the "soon" and "now" options. There was already a zero timer in here for non-CF builds, so I just used that same timer to implement this and have the non-CF code path call garbageCollectOnNextRunLoop(). * bindings/js/ScriptController.cpp: (WebCore::collectGarbageAfterWindowShellDestruction): (WebCore::ScriptController::~ScriptController): (WebCore::ScriptController::clearWindowShell): Under system memory pressure conditions, schedule a full GC on next runloop iteration instead of just asking for it to happen soon. We do it on next runloop to ensure that there's no pointer to the window object on the stack. Canonical link: https://commits.webkit.org/159702@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
56 additions
and 12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters