[Webkit-unassigned] [Bug 197344] Web Inspector: "Retained Size" does not make sense

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 1 02:22:22 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=197344

--- Comment #3 from philipp.kuederli at gmail.com ---
Thanks for the hints. I use a custom implemented React-similar way of state handling for a WebGL application where I found out thanks to the "retained size" that there is indeed a chain of last states (current -> last -> last -> last ...) caused by closures. Unfortunately I cannot extract a simple example right now and there is no public link available yet. 

So on the one hand this tool helps to find potential non-obvious memory leaks caused for example by closures. However on the other hand since this accumulated sum showed in my case 781.92 GB I almost ignored it because I thought its just a Safari developer tools bug. 

>From https://webkit.org/blog/6425/memory-debugging-with-web-inspector/ I found 
"The retained size is the size of the object plus the size of all of the nodes it dominates (the objects that this particular object solely keeps alive). An easy way to think about the retained size is if the object were to be deleted right now, the retained size would be the amount of memory that would be reclaimed."

According to this explanation it would mean it really should show a concrete amount of memory allocated at the moment. The accumulated sum however at the top level in Safari developer tools shows some "virtual" calculation which does not represent real memory like you already mentioned too. 

The question now is if the top level would only show effective 3 MB from your example instead of 6 MB would I have found the memory leak too? I guess yes however after a longer runtime (here also I would need to make an example with concrete calculation, but I don't know if this is needed). 

To summarize at the moment it seems to make no sense to investigate more since there seems to be no bugs neither in the safari tools nor in my application (after removing the leak). However I would really think about changing the measurement to have an effective memory footprint instead of a accumulated sum to prevent confusion. I had a very bad feeling about what should I trust now? Or I guess at least there should somewhere be an explanation how it is calculated. When a developer starts to profile it means he does not understand 100% anymore what is going on in his code so he has to be sure that at least the profiling tools he understands perfectly otherwise he has even more unknowns.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190501/91ddda83/attachment.html>


More information about the webkit-unassigned mailing list