Bug 230067

Summary: Implement a WebProcess cap
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, ggaren, kkinnunen, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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].