Closed
Bug 112190
Opened 24 years ago
Closed 24 years ago
leaking nsCaseConversionImpl2
Categories
(Core :: Layout, defect, P2)
Tracking
()
RESOLVED
INVALID
mozilla0.9.7
People
(Reporter: alecf, Assigned: alecf)
Details
Attachments
(1 obsolete file)
from the bloat logs, I noticed we're leaking the nsCaseConversionImpl2 service,
as well as 2 nsCompressedCharMaps (32 bytes + a 256 byte cache, each)
The leaker was nsTextTransformer, and the problem was that it wasn't releasing
the global service. The fix is to observe XPCOM shutdown and release the global
object.
Patch forthcoming. This is the same way we've fixed similar service leaks.
can I get r=nhotta, sr=attinasi?
| Assignee | ||
Comment 1•24 years ago
|
||
| Assignee | ||
Comment 2•24 years ago
|
||
er, the compressed char maps are 16 bytes each
all told this is a 556 byte leak.
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: fix in hand
Target Milestone: --- → mozilla0.9.7
Well, as I said in my review comments on bug 112209, where this patch was
accidentally included:
>Index: layout/html/base/src/nsTextTransformer.cpp
It would be much simpler if you just did this work from the layout
module destructor rather than having your own observer. If, when
(if?) we start unloading DLLs, we find that the module destructors
are doing some of these things too late, we could have one XPCOM
shutdown observer per-module and move some of the things from the
module destructor into it.
But actually, now that I look at it, we *already* have
nsTextTransformer::Shutdown to fix this. Why doesn't that work? (It should
just use NS_IF_RELEASE rather than ReleaseService, though...)
| Assignee | ||
Comment 5•24 years ago
|
||
I agree. :)
I'll go whip up a new patch.
| Assignee | ||
Comment 6•24 years ago
|
||
now this is odd. according to layout's destructor, nsTextTransformer::Shutdown
should be shutting it down, but I'm not sure it is. Maybe I need to use the
refcnt balancer :)
Whiteboard: fix in hand
Oh, you didn't? I was previously under the impression here that the reason this
was happening was that dougt broke nsIShutdownListener.
Comment 9•24 years ago
|
||
alecf: do we need to check for aTopic on ::Observe()
+nsCaseConvShutdown::Observe(nsISupports*, const char *aTopic, const PRUnichar*)
+{
----> if(!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID))
+ NS_IF_RELEASE(gCaseConv);
+ return NS_OK;
+}
or
+ obs->AddObserver(observer, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE);
guarantees the ::Observe() to be called only at shutdown?
Attachment #59342 -
Attachment is obsolete: true
A refcount log shows that HandleCaseConversionShutdown::Observe isn't getting
called. I wonder if this is the problem that some observers aren't being
notified because of dougt's observer changes that don't handle the case of
observers removing themselves during notification again.
| Assignee | ||
Comment 11•24 years ago
|
||
I think this is just bogus - I just fixed bug 110226, so this will just go away.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•