Bug 176099

Summary: [WPE] Enable MEMORY_SAMPLER
Product: WebKit Reporter: Carlos Alberto Lopez Perez <clopez>
Component: WPE WebKitAssignee: Carlos Alberto Lopez Perez <clopez>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, bugs-noreply, calvaris, clopez, kling, koivisto, mcatanzaro, webkit-bug-importer, zan
Priority: P2    
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=164517
Attachments:
Description Flags
Patch mcatanzaro: review+

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>