Increasing number of documents and elements in timeline

171 views
Skip to first unread message

Stefan Brands

unread,
Aug 3, 2017, 6:36:23 AM8/3/17
to Google Chrome Developer Tools
Hi,

We are developing a big java script application and we have a problem while testing for memory leaks.

Every time we open and close a dialog ( which is an iframe ), Chrome debugger tools timeline shows an increasing number of documents and elements:


However, when we take memory snapshots, these new documents and elements can't be found :


Could this be a problem with the developer tools ?

Regards,

Stefan Brands.

PhistucK

unread,
Aug 3, 2017, 6:41:13 AM8/3/17
to Google Chrome Developer Tools
If the Developer Tools feature is completely closed and you look at the Chrome task manager (Shift + Escape on Windows), do you see the memory of the tab goes up and up and up whenever the dialog is shown and closed?
If so, it is indeed a memory leak (either of the page, or of Chrome) and the Developer Tools feature just shows it.
Otherwise, it might be a Developer Tools feature issue that causes iFrame to be kept in the memory when they should not be and you can report this at crbug.com.

If you found that it is indeed a memory leak and you are not keeping any reference to that iFrame anywhere (I guess the Developer Tools feature can help you figure that out), it might be a memory leak of the browser, which should also be reported at crbug.com.


PhistucK

--
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-developer-tools+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/c5ff0400-29ef-47ac-a1f2-63a7d742e46a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stefan Brands

unread,
Aug 3, 2017, 9:10:50 AM8/3/17
to Google Chrome Developer Tools
Memory is not increasing in the task manager, that's why I thought it is a developer tools issue.

Thanks,

Stefan.

Alexei Filippov

unread,
Aug 3, 2017, 1:28:40 PM8/3/17
to Google Chrome Developer Tools
Hi Stefan,

I cannot reproduce the issue with the following simple page:

<html>
<body>
<script language="javascript">
function doit() {
  var f = document.body.appendChild(document.createElement('iframe'));
  f.width = 300;
  f.height = 300;
}
</script>
<button onclick="doit()">Press me</button>
</body>
</html>

Can you please double check you're taking heap snapshots at appropriate moments? Do you have an example page to take a look at?

Thanks,
Alex


On Thu, Aug 3, 2017 at 6:07 AM, Stefan Brands <s...@qad.com> wrote:
Hi,

We are developing a big java script application and we have a problem while testing for memory leaks.

Every time we open and close a dialog ( which is an iframe ), Chrome debugger tools timeline shows an increasing number of documents and elements:


However, when we take memory snapshots, these new documents and elements can't be found :


Could this be a problem with the developer tools ?

Regards,

Stefan Brands.

--
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-developer-tools+unsub...@googlegroups.com.

Alexei Filippov

unread,
Aug 3, 2017, 1:35:04 PM8/3/17
to Google Chrome Developer Tools
Wait, do you mean the number of docs and nodes does not go down right after you close the dialog while recording the timeline?
If yes, this is expected as these are cleaned up later when GC kicks in. Try forcing GC while recording timeline by pressing the trash can button on toolbar.

As for memory tab, it always perform GC upon taking a snapshot, so you never see garbage in the snapshot.

PhistucK

unread,
Aug 3, 2017, 2:32:38 PM8/3/17
to Google Chrome Developer Tools
You can search crbug.com for an existing issue and star it. If you cannot find one, file a new issue using the "New issue" link on the same page.
Please, do not add a "+1" or "Me too" or "Confirmed" (or similar) comment. It just wastes the time of Chrome engineers and sends unnecessary e-mails to all of the people who starred the issue.

You can reply with a link to the found or created issue and might get triaged (and fixed) faster.

Thank you.



PhistucK

Stefan Brands

unread,
Aug 3, 2017, 2:36:42 PM8/3/17
to Google Chrome Developer Tools
Hi Alexei,

I did double check, I'm creating snapshots at the right moments. I also know about the garbage collect button, I did use it, but still the number documents did not decrease.
Everytime I open the iframe, the number of documents increase :



I also tried reproducing this with a simple page, without success.

We have this problem with our complex Angular/Jquery/Kendo app, and the problem seems to occur when we have certain types of input on the screen ( I don't know which ones at the moment ).
I don't have an external demo page at the moment, only in house demo pages.

I'm not sure how to proceed with this. Any ideas ?

Regards,

Stefan.

Alexei Filippov

unread,
Aug 3, 2017, 4:15:49 PM8/3/17
to Google Chrome Developer Tools
So you see 13 documents in timeline even after forcing a GC. Right? That means they are indeed alive.
Are you able to identify those 13 documents when you take a heap snapshot? If yes, you can track their retainment paths in the bottom pane.
If not, this looks like a bug in DevTools, please file it with crbug.com

A hint: you can type 'Document' in the class filter in the snapshot summary page to hide unrelated items.

Stefan Brands

unread,
Aug 3, 2017, 5:40:04 PM8/3/17
to Google Chrome Developer Tools
Hi Alexei,

I just tried it again to be sure. I opened and closed the dialog 6 times. The number of documents in the timeline starts at 14, and ends at 19:


Snapshot before I started recording :


And after :


The number of documents even decreased, probably because of GC.

So, I think this is a bug.

Regards,

Stefan. 

Alexei Filippov

unread,
Aug 3, 2017, 8:51:29 PM8/3/17
to Google Chrome Developer Tools
Yes looks like a bug. I wonder how can I reproduce it.
Just to clarify, did you press GC button before finishing recording?

Stefan Brands

unread,
Aug 4, 2017, 4:21:34 AM8/4/17
to Google Chrome Developer Tools
Hi Alexei,

Yes, I pressed GC button every time after closing the dialog.
I could try to create a test page to reproduce the problem, but I'm afraid that will take me a few weeks because I'm very busy at the moment.
Would making a public demo site available, and guide you through the steps to reproduce work for you ?

Regards,

Stefan.

Alan Rew

unread,
Jul 24, 2018, 12:06:26 PM7/24/18
to Chrome DevTools
I've had the same issue with some code I'm working on that uses iframes, so I created some small .html files to reproduce it & raised this bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=866915
The sample .html file(s) are attached to the bug.
Hope this helps.
Alan
Reply all
Reply to author
Forward
0 new messages