MLK: XIF or Text encoder

VERIFIED FIXED in M11

Status

()

Core
Editor
P3
major
VERIFIED FIXED
19 years ago
17 years ago

People

(Reporter: Bruce Mitchener, Assigned: Akkana Peck)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
Current build on Solaris.

MLK: 774 bytes leaked in 3 blocks
  * This memory was allocated from:
        malloc         [rtlib.o]
        PR_Malloc      [prmem.c:38]
        nsAllocatorImpl::Alloc(unsigned int) [nsAllocator.cpp:77]
        nsAllocator::Alloc(unsigned int) [nsAllocator.cpp:143]
        nsMemoryAgent::Alloc(nsStr&,unsigned int) [nsStr.h:444]
        nsMemoryAgent::Realloc(nsStr&,unsigned int) [nsStr.h:464]
        nsStr::EnsureCapacity(nsStr&,unsigned int,nsIMemoryAgent*)
[nsStr.cpp:114]
        nsStr::GrowCapacity(nsStr&,unsigned int,nsIMemoryAgent*) [nsStr.cpp:132]
        nsStr::Append(nsStr&,const nsStr&,unsigned int,int,nsIMemoryAgent*)
[nsStr.cpp:174]
        nsString::Append(const nsStr&,int) [nsString2.cpp:922]
        nsString::Append(const nsStr&) [nsString2.h:438]
        nsAutoString::nsAutoString(const nsStr&) [nsString2.cpp:2085]
        CToken::CToken(const nsString&) [nsToken.cpp:51]
        CHTMLToken::CHTMLToken(const nsString&,nsHTMLTag) [nsHTMLTokens.cpp:51]
        CAttributeToken::CAttributeToken(const nsString&,const nsString&)
[nsHTMLTokens.cpp:1021]
        nsXIFDTD::AddAttribute(nsIParserNode&) [nsXIFDTD.cpp:632]
        nsXIFDTD::HandleStartToken(CToken*) [nsXIFDTD.cpp:690]
        XIFDispatchTokenHandler(CToken*,nsIDTD*) [nsXIFDTD.cpp:265]
        CTokenHandler::operator ()(CToken*,nsIDTD*) [nsTokenHandler.cpp:80]
        nsXIFDTD::HandleToken(CToken*,nsIParser*) [nsXIFDTD.cpp:534]

nsXIFDTD::BuildModel(nsIParser*,nsITokenizer*,nsITokenObserver*,nsIContentSink*)
[nsXIFDTD.cpp:474]
        nsParser::BuildModel() [nsParser.cpp:942]
        nsParser::ResumeParse(nsIDTD*,int) [nsParser.cpp:887]
        nsParser::Parse(const nsString&,void*,const
nsString&,int,int,eParseMode) [nsParser.cpp:772]
        nsTextEncoder::EncodeToString(nsString&) [nsDocumentEncoder.cpp:205]
        nsHTMLEditor::OutputToString(nsString&,const nsString&,unsigned int)
[nsHTMLEditor.cpp:3115]
        nsGfxTextControlFrame::SetTextControlFrameState(const nsString&)
[nsGfxTextControlFrame.cpp:661]
        nsGfxTextControlFrame::InternalContentChanged()
[nsGfxTextControlFrame.cpp:1536]

nsEnderDocumentObserver::ContentChanged(nsIDocument*,nsIContent*,nsISupports*)
[nsGfxTextControlFrame.cpp:1711]
        nsDocument::ContentChanged(nsIContent*,nsISupports*)
[nsDocument.cpp:1542]
  * Block of 258 bytes (3 times); last block at 0x17aa188

Updated

19 years ago
Assignee: buster → akkana
Target Milestone: M12

Comment 1

19 years ago
looks like the output code is the culprit here, assigning to Akkana.  Setting
milestone to M12, because this leak is isolated, so it is very unlikely to be
the cause of a cascade of leaks in other objects.  Still a high priority, but I
don't think this particular leak needs to get fixed until we're in cleanup mode.
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED
(Assignee)

Updated

19 years ago
Target Milestone: M12 → M11
(Assignee)

Comment 2

19 years ago
This may be the cause of one of he 2 large startup leaks.  Bruce has more info
in http://www.cybersight.com/~bruce/apprunner.19990912.log.  Bumping milestone
back to M11 'cause leak fixing is important.
(Assignee)

Updated

19 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 3

19 years ago
nsXIFDTD::AddAttribute was always creating a new CAttributeToken, but sometimes
(if PeekNode returned nsnull) throwing it away rather than pushing it onto the
nsDeque.

I hope this was the source of the memory leak -- I hope that nsDeque does free
the memory that it pushes.  (It looks like it calls Recycle() at least under
some circumstances.)  Someone with Purify, please verify that this was the
source of this memory leak.
(Reporter)

Updated

19 years ago
Status: RESOLVED → VERIFIED
(Reporter)

Comment 4

19 years ago
That seems to have fixed it!
You need to log in before you can comment on or make changes to this bug.