Bug 183773

Summary: WebProcess memory monitor thresholds should be better tuned for embedded systems.
Product: WebKit Reporter: Carlos Alberto Lopez Perez <clopez>
Component: WPE WebKitAssignee: Carlos Alberto Lopez Perez <clopez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, aperez, benjamin, bugs-noreply, cdumez, cmarcelo, darin, dbates, eric.carlson, ews-watchlist, jer.noble, ysuzuki
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=180861
https://bugs.webkit.org/show_bug.cgi?id=183997
Attachments:
Description Flags
Patch
none
Patch none

Description Carlos Alberto Lopez Perez 2018-03-20 05:09:32 PDT
The current thresholds for the WebProcess memory monitor are hard-coded and doesn't make sense on an embedded system where having 1GB or 512MB of RAM is usual.
Comment 1 Carlos Alberto Lopez Perez 2018-03-20 05:50:01 PDT
Created attachment 336116 [details]
Patch
Comment 2 Carlos Alberto Lopez Perez 2018-03-20 08:20:21 PDT
Created attachment 336125 [details]
Patch

Patch v2, try to fix windows build
Comment 3 Adrian Perez 2018-03-20 15:24:54 PDT
Comment on attachment 336125 [details]
Patch

Informal r=me.

Reading this patch makes me think that we might want to think whether it
might make sense to provide some API which allows programs to set their
own thresholds — each embedded application is a different beast. Dunno.

At any rate, your proposed improvements look much better to me than the
current hardcoded values, so I hope others agree and this can be landed.
Comment 4 Carlos Alberto Lopez Perez 2018-03-23 05:00:55 PDT
ping reviewers? all EWS are green.
Comment 5 Yusuke Suzuki 2018-03-23 05:06:12 PDT
Comment on attachment 336125 [details]
Patch

r=me too.
Comment 6 Carlos Alberto Lopez Perez 2018-03-23 05:41:50 PDT
Comment on attachment 336125 [details]
Patch

Clearing flags on attachment: 336125

Committed r229894: <https://trac.webkit.org/changeset/229894>
Comment 7 Carlos Alberto Lopez Perez 2018-03-23 05:41:57 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Darin Adler 2018-03-23 20:41:57 PDT
Comment on attachment 336125 [details]
Patch

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

> Source/WTF/wtf/MemoryPressureHandler.cpp:152
> +    WTFLogAlways("Unable to shrink memory footprint of process (%lu MB) below the kill thresold (%lu MB). Killed\n", footprint.value() / MB, thresholdForMemoryKill() / MB);

%lu is not the correct format for a size_t; %zu is correct. This might compile on platforms where size_t happens to be the same as unsigned long, but these %lu should be changed to %zu.
Comment 9 Carlos Alberto Lopez Perez 2018-03-25 12:34:09 PDT
(In reply to Darin Adler from comment #8)
> Comment on attachment 336125 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=336125&action=review
> 
> > Source/WTF/wtf/MemoryPressureHandler.cpp:152
> > +    WTFLogAlways("Unable to shrink memory footprint of process (%lu MB) below the kill thresold (%lu MB). Killed\n", footprint.value() / MB, thresholdForMemoryKill() / MB);
> 
> %lu is not the correct format for a size_t; %zu is correct. This might
> compile on platforms where size_t happens to be the same as unsigned long,
> but these %lu should be changed to %zu.

I picked %lu because that was used already on this file for other two messages involving size_t, but you're right: %zu should be used instead.

I have opened bug 183997 to fix this one and the other two.