Closed
Bug 380873
Opened 17 years ago
Closed 17 years ago
Increase in leak stats since landing of new password manager
Categories
(Toolkit :: Password Manager, defect)
Toolkit
Password Manager
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha7
People
(Reporter: RyanVM, Assigned: Dolske)
References
Details
(Keywords: memory-leak, regression)
Attachments
(1 file, 1 obsolete file)
2.08 KB,
patch
|
mconnor
:
review+
|
Details | Diff | Splinter Review |
From gavin's remarks in bug 374723 comment #24: This introduced some leaks on fxdebug-linux-tbox: --NEW-LEAKS-----------------------------------leaks------leaks% nsPrefBranch 120 100.00% nsVoidArray 8 100.00% XPCWrappedNative 1512 12.50% XPCWrappedNativeProto 672 9.09% nsStringBuffer 104 8.33% TOTAL 2416 If you compare with bug 378618 comment 2, I think this means that the XPCWrappedNative[Proto] and nsStringBuffer leaks are just the fault of the JS component loader, while the nsPrefBranch/nsVoidArray leaks were caused by this added code.
Flags: blocking-firefox3?
Comment 1•17 years ago
|
||
Something like attachment 265014 [details] [diff] [review] from bug 378618 should probably be applied to nsLoginManagerPrompter.js.
Comment 2•17 years ago
|
||
Just for the record, Rlk went up from 4.88KB to 5.17KB due to that patch.
Assignee | ||
Comment 3•17 years ago
|
||
Updated•17 years ago
|
Attachment #265303 -
Flags: review?(gavin.sharp) → review+
Updated•17 years ago
|
Flags: blocking-firefox3? → blocking-firefox3+
Updated•17 years ago
|
Flags: blocking-firefox3+ → blocking-firefox3?
Whiteboard: [checkin-needed]
Updated•17 years ago
|
Flags: blocking-firefox3? → blocking-firefox3+
Updated•17 years ago
|
Target Milestone: --- → Firefox 3 alpha6
Updated•17 years ago
|
Whiteboard: [checkin-needed] → [checkin needed]
Comment 4•17 years ago
|
||
mozilla/toolkit/components/passwordmgr/src/nsLoginManagerPrompter.js 1.2
Whiteboard: [checkin needed]
Comment 5•17 years ago
|
||
This patch didn't seem to have any effect on Rlk.
Assignee | ||
Comment 6•17 years ago
|
||
mconnor noted that that this was a likely source of leaks.
Attachment #268308 -
Flags: review?(mconnor)
Comment 7•17 years ago
|
||
Comment on attachment 268308 [details] [diff] [review] Use weak references with addObserver() you need to implement nsISupportsWeakReference for this to work, no?
Comment 8•17 years ago
|
||
I think as long as it can QI to nsISupportsWeakReference, it should work (which it does). See the patch in bug 340547, for an example.
Comment 9•17 years ago
|
||
Yeah, it uses XPConnect magic: http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/js/src/xpconnect/src/xpcwrappedjs.cpp&rev=1.55#282
Comment 10•17 years ago
|
||
Would it be worth trying a patch for login manager that uses the same logic as the last one in bug 378618?
Comment 11•17 years ago
|
||
Comment on attachment 268308 [details] [diff] [review] Use weak references with addObserver() ok, r=me, yay for magic
Attachment #268308 -
Flags: review?(mconnor) → review+
Comment 12•17 years ago
|
||
did this patch land? did it help enough to get back to even?
Updated•17 years ago
|
Whiteboard: [checkin needed]
Comment 13•17 years ago
|
||
No, it didn't land. Wouldn't it be better to explicitly remove the observer and the progress listener on shutdown instead of relying on the weak references? My understanding is that explicit cleanup is better when we know the exact moment we need to break the cycle. IIRC, without the weak references, pref notification is slightly more efficient, too.
Comment 14•17 years ago
|
||
Note that sayrer did some leak fixing of his own over in bug 385839. I guess we could still land this patch to see if it shows any further improvements.
Comment 15•17 years ago
|
||
The new observer registration added in bug 385839 should be changed to weak too (or removed at shutdown).
Comment 16•17 years ago
|
||
From bug 385839 comment 8: > > My understanding is that you _do_ need to remove the observers > Mano says services don't need to that (they used to). I also tried only > removing the observers, without nulling out the members. This got some of the > leaks, but not all. Mano, would you chime in and explain why this is no longer required? We should then update the relevant documentation. And the patch shouldn't be checked in, in that case.
Assignee | ||
Updated•17 years ago
|
Whiteboard: [checkin needed]
Assignee | ||
Comment 17•17 years ago
|
||
Comment on attachment 265303 [details] [diff] [review] Remove singleton from createInstance() [checked in with no visible effect] (marking obsolete based on comment #5 -- no effect on leaks seen) Also, bug 385524 will replace this code... Once the replacement stops leaking. :-)
Attachment #265303 -
Attachment is obsolete: true
Updated•17 years ago
|
Attachment #265303 -
Attachment description: Remove singleton from createInstance() → Remove singleton from createInstance() [checked in with no visible effect]
Comment 19•17 years ago
|
||
moving out, needs to make b1
Target Milestone: Firefox 3 alpha6 → Firefox 3 beta1
Comment 20•17 years ago
|
||
Over in bug 385237, I figured out that the cause of a content pref service leak is the nsIFactory that creates the service. Some testing leads me to conclude that the factories in every JS component are likely to be leaking, which may be the cause of (some of) the leaks reported in the bugs to which I am adding this comment (bug 337050, bug 378618, bug 381239, and bug 380873/bug 380931). Take a look at bug 385237, comment 2 for more details, and note that the fix for bug 180380 makes all the XPCWrappedNative and XPCWrappedNativeProto leaks (which were what the content pref service was leaking) go away and may similarly fix (some of) the leaks reported in this bug.
Assignee | ||
Comment 21•17 years ago
|
||
I think the leaks described here have now been fixed, by other various checkins (mainly the switch to XPCOMUtils) so I'm closing this. Bug 380931 has an issue about a couple of other leaks that may or may not still exist, so I'll continue looking at leaking in general there.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Product: Firefox → Toolkit
You need to log in
before you can comment on or make changes to this bug.
Description
•