Closed
Bug 503989
Opened 17 years ago
Closed 16 years ago
Pending <audio src> loads leak on shutdown (entraining nsDocument)
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
| Tracking | Status | |
|---|---|---|
| blocking2.0 | --- | beta1+ |
People
(Reporter: jruderman, Assigned: roc)
References
Details
(Keywords: memory-leak, testcase)
Attachments
(3 files)
|
354 bytes,
text/html
|
Details | |
|
10.93 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
|
26.86 KB,
patch
|
cajbir
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Reporter | ||
Updated•17 years ago
|
Summary: Pending <audio src> loads leak on shutdown (entraining nsDocument shutdown leak of nsDocument → Pending <audio src> loads leak on shutdown (entraining nsDocument)
| Reporter | ||
Comment 1•17 years ago
|
||
| Reporter | ||
Updated•17 years ago
|
| Reporter | ||
Comment 2•16 years ago
|
||
This prevents me from looking for other nsDocument leak bugs :(
| Assignee | ||
Updated•16 years ago
|
Assignee: nobody → roc
Comment 4•16 years ago
|
||
This bug states that "pending" audio src loads leak on shutdown. I am seeing that fully completed loads also leak. For example, if you let all the Audio objects fully load, then refresh the page, no memory is released, and the application's RAM usage continues to grow for every refresh.
Another test case, hosted on an external server:
http://bowser.macminicolo.net/~jhuckaby/bugs/firefox-ogg1/leak.html
Every refresh of this page results in about 15 MB more memory usage.
| Assignee | ||
Updated•16 years ago
|
blocking2.0: --- → ?
| Assignee | ||
Comment 5•16 years ago
|
||
These elements are only collected when the cycle collector runs. Are you giving the browser a chance to go idle and perform cycle collection? It should happen if you leave it alone for a few seconds.
If I run these testcases with XPCOM_MEM_LEAK_LOG=1 and shutdown, I don't see any leaks on Mac.
| Reporter | ||
Comment 6•16 years ago
|
||
I can still reproduce with the testcase in comment 1, *not* letting the browser go idle or even "finish" with the testcase. Testing Firefox trunk on Leopard.
| Reporter | ||
Comment 7•16 years ago
|
||
I can still reproduce with the testcase in comment 1, *not* letting the browser go idle or even "finish" with the testcase. Testing Firefox trunk on Leopard.
Comment 8•16 years ago
|
||
Robert, yes, you are correct. If I let the browser sit for a few seconds, THEN refresh, there is no memory leak. Thanks for catching this, I was being too impatient :)
| Assignee | ||
Comment 9•16 years ago
|
||
Some simple refactoring, since I'm going to create more shutdown observers.
Jonas, I could punt this review to Mats if you're busy and OK with him reviewing it.
Attachment #425336 -
Flags: review?(jonas)
| Assignee | ||
Comment 10•16 years ago
|
||
As described by comments in the code, we create a temporary cycle of references during media loads: after the load listener is created, and before we reach OnStartRequest, the listener references the element, which references the channel, which references the listener. We rely on OnStartRequest to break the cycle, but when we shut down with pending loads, OnStartRequest may not be called.
This patch fixes the bug by making the load listener observe shutdown notifications and break the cycle if one happens.
This patch also makes the media element observe shutdown notifications while it's holding a self-reference, and releases the self-reference if shutdown occurs. (Recall that the self-reference is used to keep the element alive while it's loading; we don't want to GC it if there's still a possibility it might fire events that would trigger listeners.)
Attachment #425338 -
Flags: review?(chris.double)
| Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs review]
Comment on attachment 425336 [details] [diff] [review]
Part 1: create nsContentUtils::Register/UnregisterShutdownObserver
Mmm... code kill..
Attachment #425336 -
Flags: review?(jonas) → review+
Updated•16 years ago
|
Attachment #425338 -
Flags: review?(chris.double) → review+
| Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs review] → [needs landing]
| Assignee | ||
Comment 12•16 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/6ede2694f90b
Followup bustage fix:
http://hg.mozilla.org/mozilla-central/rev/7c24dc44ca00
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
| Assignee | ||
Updated•16 years ago
|
blocking2.0: ? → beta1
You need to log in
before you can comment on or make changes to this bug.
Description
•