[WebKitSettings] Add API for OpportunisticSweepingAndGarbageCollectio…#1612
Merged
magomez merged 1 commit intoWebPlatformForEmbedded:wpe-2.46from Feb 5, 2026
Merged
Conversation
|
Amazing findings @asurdej-comcast !! Thanks for the debug!! |
magomez
approved these changes
Feb 5, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…nEnabled
We observe increased WebKit 2.46 average memory usage (vs 2.38) with OpportunisticSweepingAndGarbageCollectionEnabled. In case of LightningApps (webgl/non composited webgl) this option effectively disables GC timers in some cases (FullGCActivityCallback and EdenGCActivityCallback) and prevents them from running.
Initially reported as memory during video playback but I can observe it also with UI scrolling
The only source of GC is Heap.cpp:
GC timers are blocked by OpportunisticTaskScheduler, where isBusyForTimerBasedGC() is always true because of requestAnimationFrame() callback that is set over and over for LightningApp and it considered as imminently scheduled task.
Here is how WebProcess memory usage looks for hbomax app steady video playback with webkit 2.38:


marked moments are FullGCActivityCallback, beside that EdenGCActivityCallback triggers GC every 10sec
And here is how it looks with 2.46 where GC is invoked at spikes only, every ~1min. Full gc is marked with a red circle while other points are Eden GC
Disabling OpportunisticSweepingAndGarbageCollectionEnabled brings back wpe-2.38 behavior.
WebKit/WebKit@5c9eac4
WebKit/WebKit#20688