Closed Bug 422676 Opened 16 years ago Closed 13 years ago

Lot of memory (400Mb) and CPU used during a few seconds when you close a tab with a large page

Categories

(Core :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: hokkos, Unassigned)

References

()

Details

(Keywords: perf, Whiteboard: [closeme 2011-03-01])

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5pre) Gecko/2008031205 Minefield/3.0b5pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5pre) Gecko/2008031205 Minefield/3.0b5pre

When you close a large tab (and firefox uses only 150Mb) with lot of javascript the memory goes to 300mb or 500mb during 5sec, the proc goes to 100%, the disk clicks and the browser blocks, then it goes to normal.

My print screen here : http://img142.imageshack.us/my.php?image=firefoxrambigpagerr0.png

Reproducible: Always

Steps to Reproduce:
1. go to this digg page :
http://digg.com/settolerance?csorttype=c-all&return=/tech_news/Digg_This:_09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0&storyid=1901261

2. wait for the 2.000 comments to load

3. close the tab and watch the memory goes to 300mb or 500mb, the proc goes to 100% during 5sec, the disk to click and the browser to block
Actual Results:  
The memory is freed, back to normal.

Expected Results:  
The memory should goes to 500Mb when you close a tab when firefox used only 150Mb with the tab loaded.
Summary: Lot of memory (400Mb) and CPU during few seconds used when you close a large page → Lot of memory (400Mb) and CPU used during a few seconds when you close a large page
Summary: Lot of memory (400Mb) and CPU used during a few seconds when you close a large page → Lot of memory (400Mb) and CPU used during a few seconds when you close a tab with a large page
Sorry correction :

Expected Results:  
The memory should not use 500Mb when you close a tab when firefox used only
150Mb with the tab loaded.
I can reproduce with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5pre) Gecko/2008031806 Minefield/3.0b5pre, and also with Firefox 3 beta 4 and Windows XP on a different machine. Peak Mem Usage quickly jumped to over 300 MB on both machines, up from about 140 MB on one machine and about 80 MB on another.
Status: UNCONFIRMED → NEW
Ever confirmed: true
do you get a memory leak report for this when you use leak gauge (http://wiki.mozilla.org/QA:Home_Page:Firefox_3.0_TestPlan:Leaks:LeakTesting-How-To#Leak_Gauge)? 
With Firefox 3 beta 4, I get:

Leaked inner window 1679c80 (outer 1679ad0) at address 1679c80.
 ... with URI "about:blank".
Leaked outer window 1679ad0 at address 1679ad0.
Summary:
Leaked 2 out of 27 DOM Windows
Leaked 0 out of 52 documents
Leaked 0 out of 11 docshells

I don't know if this has anything to do with the hundreds of extra megabytes used temporarily. The memory use does quickly drop back to a normal level, so the memory is released. It's just for a short period of time that it's used (you may have to look at Peak Mem Usage to see it at all).
Depends on: 425452
No longer depends on: 425452
thanks steve, i will look into this today.
Hi Steve,

with the current Release Candidate of the Firefox 3 Beta 5 Version, i'm no longer able to reproduce this Leak.

Leak Gauge show me :

Results of processing log leak4.log :

Summary:
Leaked 0 out of 35 DOM Windows
Leaked 0 out of 61 documents
Leaked 0 out of 14 docshells
Leaked content nodes in 0 out of 68 documents

So this leak is maybe fixed now (we fixed a lot of leaks since Beta 4).

Would be great if you could test also when the Firefox 3 Beta 5 is released if you still get a Memory Leak Report
Version: unspecified → Trunk
With current FF3b5pre I don't have a memory leak, but the problem remains.
Product: Firefox → Core
QA Contact: general → general
Problem still present with Firefox 3.0b5
I wouldn't say that firefox leaks as all the memory seems to be given back at the end.
To better see the problem, load the page on a not too fast computer with not too much memory free left (in my config, I can replicate with this config (Winxp, 1Gb ram, 965M allocated before, loading the page, 975M after loading the page, 1,2G seen (os swapping like hell) while closing the page)

Sometimes, Firefox stops the unload script Script with a message saying this script is taking too long: http://digg.com/js/101/jquery.js:19

Looks like the problem is worst first time the page is loaded.

Confirmed in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008050806 Minefield/3.0pre.

I get a 230MB spike upon closing the tab. Curiously, I also get a 170MB spike when I navigate to this page from that one using the browser Back button.
This bug is likely a dupe of Bug 479553, which has a patch.
is this gone for you has of 2009-04-16 nightly build?
Keywords: perf
Is this bug still reproducible? URL in comment 0 is no more available.
No response to needed information. -> incomplete report
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INCOMPLETE
Install firefox on a swapless system (e.g. netbook with an ssd drive)
Open many tabs and browse in them.

When firefox becomes slow due to memory overload, try to close some tabs. Oops! oom-killer comes and kills the entire firefox process.

WHAT ELSE REPORT DO YOU NEED TO FIX THIS? As a user, I expect my system's memory to be FREED when I close tha tab, not more memory allocation for some useless caches/backups/etc. I just want to CLOSE the tab.

Prease reopen this bug.
You need to log in before you can comment on or make changes to this bug.