Skip to content

Commit

Permalink
REGRESSION (266680@main): iOS PLUM ~0.75% increased memory use
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=262575
rdar://114845469

Reviewed by Per Arne Vollan and Ryosuke Niwa.

Add a runtime-enabled setting to control whether or not the opportunistic task scheduler should be
enabled for the purposes of opportunistic sweeping and GC. This currently causes a memory regression
on PLUM, specifically on certain iPhone models.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/page/OpportunisticTaskScheduler.cpp:
(WebCore::OpportunisticTaskScheduler::runLoopObserverFired):

Canonical link: https://commits.webkit.org/268882@main
  • Loading branch information
whsieh committed Oct 4, 2023
1 parent e26a784 commit a776b38
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4914,6 +4914,22 @@ OffscreenCanvasInWorkersEnabled:
"PLATFORM(COCOA)": true
default: false

# FIXME: Reenable this on iOS once we can mitigate impact on memory use.
OpportunisticSweepingAndGarbageCollectionEnabled:
type: bool
status: internal
humanReadableName: "Opportunistic Sweeping and GC"
humanReadableDescription: "Enable Opportunistic Sweeping and GC"
category: javascript
defaultValue:
WebKitLegacy:
default: false
WebKit:
"PLATFORM(IOS_FAMILY)": false
default: true
WebCore:
default: false

OpusDecoderEnabled:
type: bool
status: mature
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/page/OpportunisticTaskScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ void OpportunisticTaskScheduler::runLoopObserverFired()
if (UNLIKELY(!page))
return;

if (!page->settings().opportunisticSweepingAndGarbageCollectionEnabled())
return;

page->performOpportunisticallyScheduledTasks(deadline);
}

Expand Down

0 comments on commit a776b38

Please sign in to comment.