Bug 238742 - Only check isPagedOut() under memory pressure
Summary: Only check isPagedOut() under memory pressure
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Geoffrey Garen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-04 09:59 PDT by Geoffrey Garen
Modified: 2022-04-04 13:56 PDT (History)
9 users (show)

See Also:


Attachments
Patch (1.90 KB, patch)
2022-04-04 10:05 PDT, Geoffrey Garen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2022-04-04 09:59:09 PDT
Only check isPagedOut() under memory pressure
Comment 1 Geoffrey Garen 2022-04-04 10:05:53 PDT
Created attachment 456581 [details]
Patch
Comment 2 Ben Nham 2022-04-04 10:11:29 PDT
One issue here is that isUnderMemoryPressure() doesn't actually tell you if the system is under memory pressure. Instead it just tells you if your process has received a critical memory pressure notification. They're not the same thing.

Maybe we need a new method isSystemUnderMemoryPressure() that checks the system-wide kern.memorystatus_vm_pressure_level sysctl on a timer or something. I guess we can implement that in another patch.
Comment 3 Geoffrey Garen 2022-04-04 11:03:00 PDT
I could change to kern.memorystatus_vm_pressure_level here. Worth it?
Comment 4 Ben Nham 2022-04-04 11:04:29 PDT
(In reply to Geoffrey Garen from comment #3)
> I could change to kern.memorystatus_vm_pressure_level here. Worth it?

I can probably write another patch that tries to do something sensible. My guess is the patch would also require a small sandbox change. Let's go with the speedo win here for now and we can test that change separately.
Comment 5 EWS 2022-04-04 13:55:12 PDT
Committed r292315 (249208@main): <https://commits.webkit.org/249208@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 456581 [details].
Comment 6 Radar WebKit Bug Importer 2022-04-04 13:56:16 PDT
<rdar://problem/91259682>