Heap profiles paths?

742 views
Skip to first unread message

Sergey Khegay

unread,
Apr 2, 2012, 4:44:43 AM4/2/12
to Google Chrome Developer Tools
Hi. When I take heap snapshot in previous versions of Google Chrome
and click on any object it show clickable path for that object from GC
roots or from DOMWindow. I also had to GC roots/to window object
selector. But now (Google Chrome 18.0.1025.142) I don't have clickable
paths and selector. Is it possible to return old tab representation or
are there some examples of new tab usage?

Yury Semikhatsky

unread,
Apr 2, 2012, 4:58:53 AM4/2/12
to Sergey Khegay, Google Chrome Developer Tools
Hi Sergey,

We removed the flat list of retainer paths in favor of hierarchical retainers view.
It looks more convenient from the user stand point as you can only expand
interesting paths to desired level. There is no way to copy a string representation
of a path yet but we are going to add some mechanism for this.

Yury

Sergey Khegay

unread,
Apr 2, 2012, 5:58:53 AM4/2/12
to Google Chrome Developer Tools
Thank you for your response.

I'll be waiting for this features. It's hardly to find real object
that holds reference and causes memory leak. Fortunately chromium-
browser still has 17.0.963.79 (Developer Build 125985 Linux) version
and I can use it for memory profiling.

Yury Semikhatsky

unread,
Apr 2, 2012, 11:34:16 AM4/2/12
to Sergey Khegay, Google Chrome Developer Tools
On Mon, Apr 2, 2012 at 1:58 PM, Sergey Khegay <k.y.s...@gmail.com> wrote:
Thank you for your response.

I'll be waiting for this features. It's hardly to find real object
that holds reference and causes memory leak.
Doesn't retainers tree work for you? It provides information about all retainers sorted by their distances from the Window.

Ilya Tikhonovsky

unread,
Apr 2, 2012, 11:44:01 AM4/2/12
to Sergey Khegay, Google Chrome Developer Tools
Could you please explain a bit your use case. 
The latest version has number of improvements such as Class name filter, retaining tree, Distance to window, delta filter for Summary view etc.
On Linux you can install the DevChannel version or the latest build from tip of tree if you want to keep the stable version for browsing.

Regards,
Tim.

Sergey Khegay

unread,
Apr 3, 2012, 3:47:23 AM4/3/12
to google-chrome-...@googlegroups.com
Thank you for your suggestion. Dev Version is really different from the stable and more useful.

I have another question. How can I clear the heap of the page? I opened dominators page example, took heap snapshot and got 7.17 MB. Then I reloaded page by pressing F5 button, took heap snapshot and got 9.7 MB (shouldn't it be initial 7.17 MB?). Than I opened another tab (the previous was not closed) and got 14.15 MB of snapshot. Are all the tabs of the same location using some kind of shared memory?


By the way, thanks to all developer team, you guys are doing great work.

Yury Semikhatsky

unread,
Apr 3, 2012, 4:39:56 AM4/3/12
to Sergey Khegay, google-chrome-...@googlegroups.com
On Tue, Apr 3, 2012 at 11:47 AM, Sergey Khegay <k.y.s...@gmail.com> wrote:
Thank you for your suggestion. Dev Version is really different from the stable and more useful.

I have another question. How can I clear the heap of the page?
Heap profiler will first run garbage collection before taking heap snapshot, so the snapshot should contain only live objects. You can trigger GC manually in Timeline panel but you shouldn't need this.
 
I opened dominators page example, took heap snapshot and got 7.17 MB. Then I reloaded page by pressing F5 button, took heap snapshot and got 9.7 MB (shouldn't it be initial 7.17 MB?).
In theory yes, but in practice it is more complicated since some objects might be cached in the VM, there may be other pages/extensions sharing same render process so after reload the heap usage will not necessarily drop to the initial level. Also it might be a memory leak in the page.

 
 Than I opened another tab (the previous was not closed) and got 14.15 MB of snapshot. Are all the tabs of the same location using some kind of shared memory?

Tabs may share same render process in which case V8 heap will be shared by the pages in those tabs. You can look at Chrome task manager to find out running render processes and pages they render.

duo...@gmail.com

unread,
Feb 21, 2013, 11:52:19 AM2/21/13
to google-chrome-...@googlegroups.com, Sergey Khegay
Hi everyone,
I have an accumulated object whose distance if 40 (!), and when I looked at the retaining tree, it has about 20 or more referrers. So, it's kind of impossible to me to find the path to Global. Is there any easy way to find path from my accumulated point to root using Retaining tree? 
Thanks a lot in advance.

Ilya Tikhonovsky

unread,
Feb 21, 2013, 2:52:20 PM2/21/13
to duo...@gmail.com, Google Chrome Developer Tools, Sergey Khegay

In the modern version of chrome the retainers tree is sorted by distance by default, so in the most cases you need to expand the first child item on the each level. 

Inline image 1

Regards,
Tim.


--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Screen Shot 2013-02-21 at 23.16.05.png
Message has been deleted

Ilya Tikhonovsky

unread,
Feb 21, 2013, 3:48:26 PM2/21/13
to Duong Nguyen, Google Chrome Developer Tools, Sergey Khegay
There were at least two errors that were fixed on WebKit and V8 sides recently so
you need to use the latest canary build of chrome.

Also it could be a problem with optimized code. You can avoid that by running chrome with disabled optimization. chrome --js-flags="--nocrankshaft --nouse-ic"
Also in that case I'd recommend to enable "Show objects' hidden properties flag" in DevTools settings.


Regards,
Tim.


On Fri, Feb 22, 2013 at 12:25 AM, Duong Nguyen <duo...@gmail.com> wrote:
Thank you very much! However, my problem was that I would never find the root. Expanding my tree just ended up finding a blurred node. I wondered if my object was unreachable, so why hadn't it been collected? Please kindly help me looking at my attached screenshot.
Many thanks!

--
/Duong

Screen Shot 2013-02-21 at 23.16.05.png

Duong Nguyen

unread,
Feb 21, 2013, 4:01:06 PM2/21/13
to Ilya Tikhonovsky, Google Chrome Developer Tools, Sergey Khegay
Thanks for helping. I will give it a try.
--
/Duong
Screen Shot 2013-02-21 at 23.16.05.png

Duong Nguyen

unread,
Feb 26, 2013, 8:37:47 AM2/26/13
to google-chrome-...@googlegroups.com
Thank you all very much for helping. I am now facing another problem. My application using many iframes to wrap server side pages and the iframe window objects all retained after the corresponding iframe elements are destroyed. Looking at the retaining tree I found only global, and builtin objects from which I couldn't figure out what is keeping my iframe window alive. Could any one please have a look on the screenshot and teach me why. Million thanks in advance.


Ilya Tikhonovsky

unread,
Feb 26, 2013, 9:56:13 AM2/26/13
to Duong Nguyen, Google Chrome Developer Tools
The good idea is to do the next actions:

fix all the errors that report something into console.
disable all extensions.
run a fresh instance of chrome canary.
have a single tab with the testing page.
have no breakpoints in Scripts panel.
have switched off 'stop on exception' button.
do not open Elements panel.

because all these things may affect the heap snapshot.

As example today I found a problem with an extension that retained almost everything in the page and as a result I saw a leak 1mb per each reload.

Regards,
Tim.


On Tue, Feb 26, 2013 at 5:37 PM, Duong Nguyen <duo...@gmail.com> wrote:
Thank you all very much for helping. I am now facing another problem. My application using many iframes to wrap server side pages and the iframe window objects all retained after the corresponding iframe elements are destroyed. Looking at the retaining tree I found only global, and builtin objects from which I couldn't figure out what is keeping my iframe window alive. Could any one please have a look on the screenshot and teach me why. Million thanks in advance.


Reply all
Reply to author
Forward
0 new messages