Bug 176099 - [WPE] Enable MEMORY_SAMPLER
Summary: [WPE] Enable MEMORY_SAMPLER
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Alberto Lopez Perez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-30 06:01 PDT by Carlos Alberto Lopez Perez
Modified: 2022-02-28 03:47 PST (History)
9 users (show)

See Also:


Attachments
Patch (2.85 KB, patch)
2017-08-30 06:57 PDT, Carlos Alberto Lopez Perez
mcatanzaro: review+
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 2017-08-30 06:01:47 PDT
The GTK+ port enables (build-time) the MEMORY_SAMPLE feature by default. Let's do this also for WPE.

With this feature enabled, you can then set the environment variable WEBKIT_SAMPLE_MEMORY=1 and each second you will get detailed memory stats of the WebKit internals printed on a file with the name of the process in /tmp

If the environment variable is not set, then this does nothing.
Comment 1 Carlos Alberto Lopez Perez 2017-08-30 06:57:52 PDT
Created attachment 319361 [details]
Patch
Comment 2 Michael Catanzaro 2017-08-30 07:36:15 PDT
Comment on attachment 319361 [details]
Patch

I think you want it to be PRIVATE as nobody would ever want to do a release build with it enabled.
Comment 3 Carlos Alberto Lopez Perez 2017-08-30 07:47:18 PDT
(In reply to Michael Catanzaro from comment #2)
> Comment on attachment 319361 [details]
> Patch
> 
> I think you want it to be PRIVATE as nobody would ever want to do a release
> build with it enabled.

do you mean "that nobody will want to disable this" ?

On the GTK+ port is also set like this (PUBLIC) and this is getting enabled on all the GTK+ release builds by default. I want this enabled at build time on all release builds. Its just disabled by default at runtime.

Its really useful when you need to answer questions like "why WebKit is using more memory than expected on this webpage? is because some JS leak or something else?." The file it generates is easily parsed with a script to produce nice charts.
Comment 4 Michael Catanzaro 2017-08-30 07:51:03 PDT
OK let me flip the question around: why would you want to *dis*able it, then? I think it should be PRIVATE for GTK+ too.
Comment 5 Carlos Alberto Lopez Perez 2017-08-30 07:58:35 PDT
(In reply to Michael Catanzaro from comment #4)
> OK let me flip the question around: why would you want to *dis*able it,
> then? I think it should be PRIVATE for GTK+ too.

OK.. I will switch it to private (and set the GTK+ one to private also)
Comment 6 Carlos Alberto Lopez Perez 2017-08-30 08:06:52 PDT
Committed r221372: <http://trac.webkit.org/changeset/221372>