Bug 230067 - Implement a WebProcess cap
Summary: Implement a WebProcess cap
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-08 15:06 PDT by Chris Dumez
Modified: 2021-09-09 09:40 PDT (History)
6 users (show)

See Also:


Attachments
Patch (19.77 KB, patch)
2021-09-08 15:24 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (20.12 KB, patch)
2021-09-09 07:47 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-09-08 15:06:59 PDT
Implement a WebProcess cap to avoid getting into a state where we run out of resources and crash in various ways.
Comment 1 Chris Dumez 2021-09-08 15:07:11 PDT
<rdar://79479244>
Comment 2 Chris Dumez 2021-09-08 15:24:42 PDT
Created attachment 437668 [details]
Patch
Comment 3 Geoffrey Garen 2021-09-08 19:55:16 PDT
Comment on attachment 437668 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437668&action=review

Does moving to foreground mark a process as recently used? (Would be nice to add that, if not.)

> Source/WebKit/Shared/ProcessTerminationReason.h:33
> +    ExceededProcessLimit,

Let's call this ExceededProcessCountLimit, since we call it a process count limit elsewhere.

> Source/WebKit/UIProcess/WebProcessProxy.cpp:111
> +static unsigned maxProcessCount { 400 };

s_maxProcessCount
Comment 4 Chris Dumez 2021-09-09 07:22:06 PDT
Comment on attachment 437668 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437668&action=review

>> Source/WebKit/Shared/ProcessTerminationReason.h:33
>> +    ExceededProcessLimit,
> 
> Let's call this ExceededProcessCountLimit, since we call it a process count limit elsewhere.

OK.

>> Source/WebKit/UIProcess/WebProcessProxy.cpp:111
>> +static unsigned maxProcessCount { 400 };
> 
> s_maxProcessCount

I thought the s_ prefix was only used for static data members but OK.
Comment 5 Chris Dumez 2021-09-09 07:22:31 PDT
(In reply to Geoffrey Garen from comment #3)
> Comment on attachment 437668 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=437668&action=review
> 
> Does moving to foreground mark a process as recently used? (Would be nice to
> add that, if not.)

It currently doesn't but this is a good point and I'll fix it.
Comment 6 Chris Dumez 2021-09-09 07:47:30 PDT
Created attachment 437742 [details]
Patch
Comment 7 EWS 2021-09-09 09:40:54 PDT
Committed r282218 (241505@main): <https://commits.webkit.org/241505@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437742 [details].