Bug 183773 - WebProcess memory monitor thresholds should be better tuned for embedded systems.
Summary: WebProcess memory monitor thresholds should be better tuned for embedded syst...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Alberto Lopez Perez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-20 05:09 PDT by Carlos Alberto Lopez Perez
Modified: 2018-03-25 17:53 PDT (History)
12 users (show)

See Also:


Attachments
Patch (3.58 KB, patch)
2018-03-20 05:50 PDT, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff
Patch (3.59 KB, patch)
2018-03-20 08:20 PDT, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.