[Webkit-unassigned] [Bug 10773] Memory usage grows when reloading google.com/ig

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 15 01:37:23 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=10773





------- Comment #10 from sanjay12 at gmail.com  2007-01-15 01:37 PDT -------
After further investigation, one way to get the leak to stop happening is by
moving the call to forgetAllDOMNodesForDocument from Document::~Document() to
Document::detach(). However, this is not a real solution since documents can
potentially reattach themselves. Also, this change only affects the test case
and the www.google.com/ig case, but www.gmail.com still leaks memory. But it
does give some further insight as to what is happening.

Basically, in the ig leak case, the JS engine is holding a reference to the
Document object. Since that reference is held, the Document destructor is never
called, so the Document holds a reference to all the other DOM objects in the
page. So the leak is the Document + all of its child objects still being held
by native code and as a result unable to be freed.

So the key to fixing this will be figuring out why the JS engine is holding
onto the Document object in this particular case, whereas in other similar
cases it correctly releases it. Once we can get the JS engine to relinquish its
reference to the Document, that will allow ~Document() to be called, which will
clear out all the other objects.

As some added notes, bdash was able to reduce the test case further here:
http://paste.lisp.org/display/35330

And othermaciej had this to add in IRC about the conditions in which the
reference to Document is being held:
"I would guess you have to assign the variable holding the document or the
document itself or something with the document in scope to the prototype"


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list