Search code examples
google-chromememory-profilingweb-developer-toolbar

What is "Document count" counter in Timeline tab of Chrome Dev Toolbar?


Could someone explain me what does 'Document count' counter stands for in Timeline tab of Chrome Dev Toolbar?

In my application I'm using iframes and navigate within a set of pages in one of them. Currently 'Document count' counter shows me a range of values 23-32, what doest it stand for?

Thanks in advance.


Solution

  • It is number of live document resources in the inspected render process. According to documentation:

    Is my page using too much memory? - the Timeline memory view and Chrome task manager can help you identify if you’re using too much memory. Memory view can track the number of live DOM nodes, documents and JS event listeners in the inspected render process. As a rule of thumb: avoid holding references to DOM elements you no longer need to use, unbind unneeded event listeners and take care when storing large chunks of data you aren't going to use.

    Reference: https://developer.chrome.com/devtools/docs/javascript-memory-profiling#questions-to-ask-yourself

    Your application may load document resources (The load event is fired once all of the document’s resources (images and CSS files, and so forth) have been fully loaded) and then close them. To verify that a certain application operation doesn't create leaks (e.g. usually a pair of direct and reverse operations, like opening a document, and then closing it, should not leave any garbage), you may compare multiple snapshots to each other.