Note: There are a few cases of duplicates in user autocompletion which are being worked on.

leaking documents and webshells while running editor

VERIFIED FIXED in M18

Status

()

Core
XUL
P1
normal
VERIFIED FIXED
18 years ago
9 years ago

People

(Reporter: Warren Harris, Assigned: dbaron)

Tracking

({mlk})

Trunk
All
Windows NT
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nsbeta3+])

Attachments

(6 attachments)

(Reporter)

Description

18 years ago
Akkana Peck did this:

  setenv XPCOM_MEM_BLOAT_LOG 1
  script
  apprunner -edit
  (typed a few characters, did Debug->Output HTML, then quit)
  ^D (to end the script)

and said:

   We're leaking 1023 nsCSSSelectors and 12 CSSStyleSheetImpls.

Pierre, can you investigate.

[PTD team: we don't know the extent of the memory bloat due to this yet. We
just know it's unnecessary.]

Comment 1

18 years ago
Created attachment 2458 [details]
LEAK AND BLOAT STATISTICS: Win32 console output

Updated

18 years ago
Assignee: pierre → beard
Summary: MLK: leaking nsCSSSelectors and CSSStyleSheetImpls while running editor → MLK: leaking documents and webshells while running editor

Comment 2

18 years ago
The style leaks are the result of leaks at a higher level. As you can see in the
attached Win32 console output, we are leaking the following objects:

     object               total leaked
     ------               ------------
     nsDocument              5
     DocumentViewerImpl     15
     nsWebShellWindow        3
     nsWebShell              6
     PresShell               7
     nsPresContext           7

We don't have a clear owner for nsDocument or nsWebShell so I'm humbly submitting
this to beard who's got the best tools in the Valley to do that kind of work.

Changed the summary line to "leaking documents and webshells" from "leaking
nsCSSSelectors and CSSStyleSheetImpls".

Comment 3

18 years ago
*** Bug 17389 has been marked as a duplicate of this bug. ***

Updated

18 years ago
Status: NEW → ASSIGNED
Summary: MLK: leaking documents and webshells while running editor → [MLK] leaking documents and webshells while running editor

Updated

18 years ago
Blocks: 17557

Comment 4

18 years ago
I don't see these same leaks, but I see others. Leak detection is a
moving target.

Updated

18 years ago
Keywords: mlk

Updated

18 years ago
Summary: [MLK] leaking documents and webshells while running editor → leaking documents and webshells while running editor

Comment 5

17 years ago
Style person should follow up on these leaks. They are evidently shutdown leaks, 
as they don't appear as transient leaks with the Boehm leak detector.
Assignee: beard → pierre
Status: ASSIGNED → NEW

Comment 6

17 years ago
On Mac, just starting up and shutting down leaks these, which prevent the 
nsIOService (and related services) from shutting down properly.

                       Total      Rem
CSSLoaderImpl             18        5
CSSParserImpl             90        7
CSSStyleSheetImpl         92       91
CSSStyleSheetInner        54       53

...but I don't see the same problem on WindowsNT.

Updated

17 years ago
Blocks: 29702

Updated

17 years ago
Blocks: 34663

Updated

17 years ago
Blocks: 33821

Updated

17 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → M18

Comment 7

17 years ago
CCd attinasi. Gordon says that it only happens in the Mac but it may be related 
to the other XP leaks that Marc has on his list.

Comment 8

17 years ago
Really CCd attinasi...

Comment 9

17 years ago
How come this is still on my list?
Trying for the 3rd time to reassign to attinasi...
Assignee: pierre → attinasi
Status: ASSIGNED → NEW

Updated

17 years ago
Status: NEW → ASSIGNED

Comment 10

17 years ago
This bug has been marked "future" because the original netscape engineer working 
on this is over-burdened. If you feel this is an error, that you or another 
known resource will be working on this bug,or if it blocks your work in some way 
-- please attach your concern to the bug for reconsideration.
Target Milestone: M18 → Future

Updated

17 years ago
Blocks: 21650
(Reporter)

Comment 11

17 years ago
=> TK at AOL
Assignee: attinasi → TkThyag
Status: ASSIGNED → NEW
(Reporter)

Updated

17 years ago
Target Milestone: Future → M20

Updated

17 years ago
Status: NEW → ASSIGNED
(Reporter)

Comment 12

17 years ago
reassigning to dbaron
Assignee: TkThyag → dbaron
Status: ASSIGNED → NEW
(Assignee)

Comment 13

17 years ago
I believe the fix I attached yesterday to bug 24645 should fix this bug.  The 
root of the leak was the XUL keybinding document table, which was intentionally 
leaked to fix bug 27739.  However, just releasing the table was not sufficient 
because nobody was breaking the circular references between the keybinding 
documents (nsXULDocument objects) and their script objects, which would explain 
the state of this bug before.  (Note that there were 3 XULDocumentImpl leaked in 
pierre's original bloat log attached above.  This is what I saw before breaking 
the circular references.)
Status: NEW → ASSIGNED
Component: Style System → XP Toolkit/Widgets: XUL
(Assignee)

Comment 14

17 years ago
Proposed patch is:
http://bugzilla.mozilla.org/showattachment.cgi?attach_id=11213
(Assignee)

Comment 15

17 years ago
Actually, this doesn't fix all the leaks when starting with mozilla -editor.  
I'm working on this new leak.  In fact, I'm writing a tutorial by writing down 
exactly what I do to find it.  It's going to be an interesting tutorial...
(Assignee)

Comment 16

17 years ago
Part or all of the remaining leak has something to do with DocumentType objects
not having their script objects un-rooted when the
nsDocument::SetScriptGlobalObject(null) is called.  This function needs to call
SetDocument on all the elements in mProlog and mEpilog instead of just on
mRootContent.  Probably it needs to do the same elsewhere.

I'm not sure if that will fix the whole thing.  There may be a problem with
SetOpenerWindow too...
(Assignee)

Comment 17

17 years ago
Created attachment 11293 [details] [diff] [review]
patch to fix the "./mozilla -editor" startup leak
(Assignee)

Comment 18

17 years ago
Created attachment 11614 [details] [diff] [review]
revised patch
(Assignee)

Updated

17 years ago
Keywords: nsbeta3, review
Priority: P3 → P1
Target Milestone: M20 → M18
(Assignee)

Comment 19

17 years ago
Created attachment 11801 [details] [diff] [review]
revised patch, cleaning up a bunch of other issues in the same file
(Assignee)

Comment 20

17 years ago
Created attachment 11980 [details] [diff] [review]
also needed
(Assignee)

Comment 21

17 years ago
Created attachment 12018 [details] [diff] [review]
a diff -uw (ignoring whitespace) of that patch "also needed"
(Reporter)

Updated

17 years ago
Whiteboard: [nsbeta3+]
(Assignee)

Comment 22

17 years ago
I checked in the keybindings table / keybindings document part of the fix.

Updated

17 years ago
QA Contact: jrgm
(Assignee)

Comment 23

17 years ago
Was unable to check in due to cvs lock in layout/html/style/src.  Will try again
another time.
Keywords: review
(Assignee)

Comment 24

17 years ago
Fix checked in, 2000-08-06 20:03 PDT.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 25

17 years ago
*** Bug 42970 has been marked as a duplicate of this bug. ***

Comment 26

17 years ago
verified that the patches are in. Marking as such.
Status: RESOLVED → VERIFIED
(Assignee)

Comment 27

17 years ago
*** Bug 39855 has been marked as a duplicate of this bug. ***

Updated

9 years ago
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.