Closed
Bug 71623
Opened 24 years ago
Closed 17 years ago
leaks caused by ownership cycle through event listeners and JS
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
RESOLVED
WORKSFORME
Future
People
(Reporter: dbaron, Assigned: saari)
References
()
Details
(Keywords: helpwanted, memory-leak)
DESCRIPTION: Without the fix for bug 31847, I'm seeing leaks loading
http://www.people.fas.harvard.edu/~dbaron/dom/test/two-events/EventTarget
and pressing the button.
The cause of the leaks seems to be (I think!):
* nsJSDOMEventListener objects own an nsJSContext (mContext)
* the nsJSContext has a rooted script object (why?)
* this root prevents the document from being GCed
* the document owns the nsEventListenerManager
* the nsEventListenerManager owns the nsJSDOMEventListener (cycle)
The fix to bug 31847 obviously entrains a lot more stuff in this leak since that
fix essentially adds ownership where we needed ownership to prevent a crash.
Comment 1•24 years ago
|
||
So when are you seeing the leaks? Of the 7 listeners on the page I can see the
3 that get removed getting destroyed. If I switch pages a couple times I can
see the other 4 get removed when the GC eventually collects the script objects.
Running WinNT with a few local changes though I don't think offhand they'd
affect leakage.
On a side note on the test case, the capturers will start working with the fix
in my tree now. Not sure if you just haven't gotten around to updating stuff
but 'currentNode' was changed to 'currentTarget'. Bubbles and cancelable work
also, at least locally for me.
David, could you confirm that this still happens? I wonder if GC just hadn't
yet fired. Also wonder if Tom's fix has solved it.
Reporter | ||
Comment 3•24 years ago
|
||
This does still happen. joki's right that it isn't really a problem though,
except that it makes leak finding harder. That jscontext_savedroot gets
unrooted if I go to a different page before exiting.
Futuring since we can live with this one and Joki is swamped.
Keywords: helpwanted
Target Milestone: --- → Future
Updated•23 years ago
|
QA Contact: madhur → rakeshmishra
Updated•22 years ago
|
QA Contact: rakeshmishra → trix
Reporter | ||
Updated•21 years ago
|
Reporter | ||
Comment 7•20 years ago
|
||
Maybe duplicate of bug 241518 if the problem still exists.
Comment 8•17 years ago
|
||
We don't leak on this test anymore, marking WFM.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•