Closed
Bug 622361
Opened 14 years ago
Closed 14 years ago
Leak nsGlobalWindow with localStorage, session history
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla2.0b10
Tracking | Status | |
---|---|---|
blocking2.0 | --- | final+ |
People
(Reporter: jruderman, Assigned: khuey)
References
Details
(Keywords: memory-leak, testcase, Whiteboard: [softblocker])
Attachments
(2 files, 3 obsolete files)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Comment 1•14 years ago
|
||
Reporter | ||
Updated•14 years ago
|
blocking2.0: --- → ?
Comment 2•14 years ago
|
||
If this gets b+ I can take it.
Assignee | ||
Comment 3•14 years ago
|
||
I poked at this briefly, didn't quite figure the whole thing out, but made some progress:
There's what looks like a cycle between nsDOMStorageDBWrapper (which doesn't use the MOZ_COUNT_CTOR/MOZ_COUNT_DTOR macros!), an nsTimerImpl that it owns, an nsDOMStorage that is observing the timer (so the timer owns it), and a DOMStorageImpl. Normally nsDOMStorageDBWrapper::StopTempTableFlushTimer destroys the timer but it never gets called. The two places it can get called from are nsDOMStorageDBWrapper's dtor which isn't going to happen since we have a cycle and when the timer fires at [1]. We never end up in UnflushedDataExists, so I assume the timer never fires, but that's where I quit debugging.
[1] http://mxr.mozilla.org/mozilla-central/source/dom/src/storage/nsDOMStorage.cpp#444
Assignee | ||
Comment 4•14 years ago
|
||
That's an nsDOMStorageManager that is observing the timer.
Assignee | ||
Comment 5•14 years ago
|
||
Or maybe it's not a cycle there, it doesn't look like nsDOMStorageManager owns anything.
Comment 6•14 years ago
|
||
nsGlobalWindow leaks are uncool, Honza, or Kyle, please do have a closer look.
blocking2.0: ? → final+
Whiteboard: [softblocker]
Assignee | ||
Comment 7•14 years ago
|
||
Assignee | ||
Updated•14 years ago
|
Attachment #500608 -
Attachment is obsolete: true
Assignee | ||
Comment 8•14 years ago
|
||
I've figured this one out. Patch in the morning.
Assignee: nobody → khuey
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → All
Assignee | ||
Comment 9•14 years ago
|
||
Assignee | ||
Comment 10•14 years ago
|
||
Comment on attachment 503806 [details] [diff] [review]
Pending storage events need to be cycle collected.
So, the issue here is that pending storage events form a cycle with the nsGlobalWindow. This would not be an issue if we ever dispatched them, but in Jesse's testcase the window is never Unfrozen and the events are never fired. Thus, we need to cycle collect the nsDOMStorageEventArray.
Attachment #503806 -
Flags: review?(honzab.moz)
Assignee | ||
Updated•14 years ago
|
Attachment #503806 -
Flags: review?(jst)
Assignee | ||
Updated•14 years ago
|
Attachment #503806 -
Attachment is obsolete: true
Attachment #503806 -
Flags: review?(jst)
Attachment #503806 -
Flags: review?(honzab.moz)
Assignee | ||
Comment 11•14 years ago
|
||
Assignee | ||
Comment 12•14 years ago
|
||
Comment on attachment 503829 [details] [diff] [review]
Pending storage events need to be cycle collected.
This has a better test. I managed to get it down to just one setTimeout.
Attachment #503829 -
Flags: review?(honzab.moz)
Assignee | ||
Updated•14 years ago
|
Attachment #503829 -
Flags: review?(jst)
Assignee | ||
Updated•14 years ago
|
Attachment #503742 -
Attachment is obsolete: true
Updated•14 years ago
|
Attachment #503829 -
Flags: review?(jst) → review+
Assignee | ||
Updated•14 years ago
|
Attachment #503829 -
Flags: review?(honzab.moz)
Assignee | ||
Comment 13•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b10
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•