Memory Timeline

1,040 views
Skip to first unread message

maxpr...@gmail.com

unread,
Jul 12, 2012, 10:11:50 AM7/12/12
to google-chrome-...@googlegroups.com
Hello,

   I'm confused about a graph in  the timeline tool. As you can see in the attachement, the "DOM node count" and "Event Listener counts" are growing while the memory is still on about the same value. Seems like a leak but the memory is garbage collected and the level don't grow the same as DOM node and Event Listener increase, so what does it means ? 
  Another bonus question : what is "document count" ?

Many tks :)
devtool-timeline.png

Ilya Tikhonovsky

unread,
Jul 12, 2012, 10:33:01 AM7/12/12
to maxpr...@gmail.com, google-chrome-...@googlegroups.com
The page can create a big detached DOM tree and keep it in native memory by single javascript DOM wrapper object.
The graph shows only Javascript memory.
Your page can have many iframes with their own documents.

Regards,
Tim.

maxpr...@gmail.com

unread,
Jul 14, 2012, 5:12:26 AM7/14/12
to google-chrome-...@googlegroups.com
Hi IIya ! Can you explain me what you mean while you're talking about "detached DOM tree", "native memory". For the example, there's no iframe in the app.

Best Regards

PhistucK

unread,
Jul 14, 2012, 5:24:06 AM7/14/12
to maxpr...@gmail.com, google-chrome-...@googlegroups.com
Detached DOM tree is when you create DOM elements but not inserting them to the document (or, removing elements from the document but still keep references to them in non garbage collected variables).
var someElement = document.createElement("bla"); // A detached DOM tree.
someElement.appendChild(document.createElement("bli")); // Still a detached DOM tree.
document.body.appendChild(someElement); // No longer detached.

var someOtherElement = document.body.firstChild // Non detached DOM tree.
someOtherElement = someOtherElement.parentNode.removeChild(someOtherElement); // A detached DOM tree.

These variables are global variables for the sake of this example. Global variables are never garbage collected, I believe.

PhistucK
Message has been deleted

maxpr...@gmail.com

unread,
Jul 17, 2012, 4:45:20 AM7/17/12
to google-chrome-...@googlegroups.com, maxpr...@gmail.com
Hi Phistuck ! it's ok but why the upper memory graph don't grow to ?
Reply all
Reply to author
Forward
0 new messages