Open Bug 830103 Opened 11 years ago Updated 2 years ago

Memory leak (and network activity) after stopping load of a big page

Categories

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

x86_64
Windows 7
defect

Tracking

()

People

(Reporter: avih, Unassigned)

Details

(Whiteboard: [MemShrink:P3])

This happens both with (my own build of) nightly and with the official Firefox 18.

Steps to reproduce:

1. Visit http://dumps.wikimedia.org/enwiki/latest/
2. Click the first file link (enwiki-latest-abstract.xml) - it's a 3.6G file.
3. Wait few seconds, press the stop button.

Expected result:
- Network activity stops.

Actual result:
- Network activity continues (apparently as long as the file hasn't finished download).

4. Press the back button.

Expected result:
1. browser is quickly responsive again at the initial visited page.
2. memory of whatever got downloaded is released (as we're back at the context of the first visited page).

Actual result:
1. UI is unresponsive for many seconds, but finally it responds again.
2. Memory isn't released (nor after closing the tab, nor after clicking GC/CC/Minimize-memory at about:memory)
Note: On my tests memory usage quickly got very big, and after waiting few (10-15) seconds and pressing the back button, I was left with 2.5G of unreleased/unreleasable memory.
Can you reproduce in safe mode?
Whiteboard: [MemShrink]
I managed to reproduce this.
What does about:memory look like?
Would be good to test if this is a regression?
(My guess is no, and that this is related to XML loading.)
I tested firefox 4,8,11,15,17,18.

The short version:
- All tested versions keep network activity after stop.
- I was unable to reproduce the unreleased memory on any version.

The long version:

It appears that on all version which I tested, the network activity does stop temporarily after pressing Stop, but resumes immediately, and even after waiting many seconds (30 at least) I never saw it stop. When pressing the back button afterwards, it does stop.

Memory usage pattern grows as the download progresses (before or after pressing stop), in a saw-tooth like pattern (slowly accumulates extra X MB, then drops slightly less than X, repeatedly).

The big memory increase happens when pressing back. I'd estimate at least 10X the amount which was downloaded, possibly much more. I easily saw memory usage grows from ~120M on startup to about 200M before pressing back, to 1+G several seconds after pressing back, while surely I didn't download more than 20M-30M during that time (I can see the network throughput using a network monitor).

However - I'm unable to reproduce the memory not releasing after pressing back. On all my repeated tests, memory would be released few seconds later. Neither with a clean profile (for the official versions which I tested), nor with my nightly (also with a clean profile), which didn't release the memory earlier even after about a minute, but did release the memory after few seconds now.

It possibly would have released it if I gave it more time though (on my initial tests which led to the initial report). The fact that Firefox mem usage got to nearly 3G might be related (before my initial report), Though my system has 12G ram, so I don't imagine swapping playing a part here.
> (My guess is ... that this is related to XML loading.)

How can you tell?  If it's XML-only, that is much less important than if it happens for all file types.
Whiteboard: [MemShrink] → [MemShrink:P3]
Component: DOM: Other → DOM
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.