Closed Bug 303474 Opened 19 years ago Closed 19 years ago

Memory leak when appending/removing elements to/from a document

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED INVALID

People

(Reporter: julien.lecomte, Unassigned)

Details

(Keywords: testcase)

Attachments

(4 files, 1 obsolete file)

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Attached is a test case. Press the 'start test' button and watch the memory 
increasing, slowly first, then very steadily.

Reproducible: Always



Expected Results:  
Since the containing element is removed from the DOM at each iteration, the 
memory footprint should stay approximately the same.
Attached file Test case (obsolete) —
On my machine, the memory footprint stays approximately the same for about 30
seconds, then it starts increasing steadily.
Keywords: testcase
Just tried on Firefox 1.0.6 (User agent: Mozilla/5.0 (Windows; U; Windows NT 
5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6) on a different Windows 
machine, and I get the same result (memory footprint flat for 30/40 seconds, 
then steadily increasing)
Deer Park Alpha 2 (User agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.8b3) Gecko/20050712 Firefox/1.0+) has the same exact problem.

In comparison, IE6 memory footprint is very stable.
Attached image Memory profile graph
Blue: Firefox 1.0.6
Pink: IE6 SP2 for comparison

You can observe very clearly the leak on this graph after only 20 seconds.
Attached file Fixed test case
There was a small typo in the first test case. This new test case fixes it. It
does not change anything to the result shown in the graph.
Attachment #191639 - Attachment is obsolete: true
After removing the loop from the test case, the same thing happens, but later
(85 seconds instead of 20 seconds)
Attached image No leak graph
Ran the same test for 10 minutes and the GC finally kicks in...
Closing invalid per the last experiment.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: