Closed Bug 658604 Opened 13 years ago Closed 13 years ago

Firefox crashes with many tabs and large images causing OOM

Categories

(Firefox :: General, defect)

4.0 Branch
defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 660577

People

(Reporter: edinkc, Unassigned)

References

Details

(Keywords: memory-footprint, Whiteboard: First reported as a memory leak, bug 657759, [bugday-2011-05-27])

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17

Firefox 4.0.1 can be crashed by opening multiple TABs if each TAB contains a dozen high resolution 2MB pictures. Firefox 3.6.17 does not crash. Other browsers do not crash. *Only* the latest Firefox 4.0.1 crashes. I Private Messaged the links to people at forums, all of whom have crashed their Firefox 4.01.

I could not post the links because they are adult links and I had no other non-adult links to use as examples.



Reproducible: Always

Steps to Reproduce:
1. The more of the links provided below you open, the faster the latest Firefox 4.0.1 will crash, the faster you can see it consume more than 2GB of RAM without releasing it back.
2. Firefox 3.6.17 or other browsers handle this OK - conclusively proving that this is a Firefox 4 problem only.
3.

Actual Results:  
Firefox 4.0.1 crashes, after consuming more and more RAM.
Firefox 3.6 does not crash, other browsers do not crash.

Expected Results:  
Firefox 4 should not consume over 2GB of RAM or crash if other browsers, including Firefox 3.6 do not.

Here are the links. *WARNING* They are adult links, if you have extensions allowing you to right click and Open Link in New TABs, you can do that without looking at the adult links. The more you open, the faster Firefox 4.0.1 will crash. Watch it using up more and more RAM by using native Windows monitoring or by using MemInfo displaying total system RAM usage in the task bar, which will skyrocket before crashing Firefox 4.0.1: http://www.carthagosoft.net/meminfo.zip

Once again *warning* adult links, do not open at work or where inappropriate:

Right click Open in new TABs simultaneously and watch Firefox 4.0.1 consume RAM and crash:

http://www.fusker.lv/index.php?lid=320791&query=18xgirls&
http://www.fusker.lv/index.php?lid=320790&query=18xgirls&
http://www.fusker.lv/index.php?lid=320789&query=18xgirls&
http://www.fusker.lv/index.php?lid=320788&query=18xgirls&
http://www.fusker.lv/index.php?lid=320787&query=18xgirls&
http://www.fusker.lv/index.php?lid=320786&query=18xgirls&
http://www.fusker.lv/index.php?lid=320772&query=18xgirls&
http://www.fusker.lv/index.php?lid=320769&query=18xgirls&
http://www.fusker.lv/index.php?lid=320768&query=18xgirls&
http://www.fusker.lv/index.php?lid=320767&query=18xgirls&
http://www.fusker.lv/index.php?lid=320765&query=18xgirls&
http://www.fusker.lv/index.php?lid=320760&query=18xgirls&
http://www.fusker.lv/index.php?lid=320758&query=18xgirls&
http://www.fusker.lv/index.php?lid=320754&query=18xgirls&
http://www.fusker.lv/index.php?lid=320753&query=18xgirls&
http://www.fusker.lv/index.php?lid=320747&query=18xgirls&
http://www.fusker.lv/index.php?lid=320744&query=18xgirls&
http://www.fusker.lv/index.php?lid=320738&query=18xgirls&
http://www.fusker.lv/index.php?lid=320706&query=18xgirls&
http://www.fusker.lv/index.php?lid=320704&query=18xgirls&
http://www.fusker.lv/index.php?lid=320703&query=18xgirls&
http://www.fusker.lv/index.php?lid=320702&query=18xgirls&
http://www.fusker.lv/index.php?lid=320701&query=18xgirls&
http://www.fusker.lv/index.php?lid=285457&query=18xgirls&
http://www.fusker.lv/index.php?lid=285452&query=18xgirls&
http://www.fusker.lv/index.php?lid=285380&query=18xgirls&
http://www.fusker.lv/index.php?lid=285379&query=18xgirls&
http://www.fusker.lv/index.php?lid=285378&query=18xgirls&
http://www.fusker.lv/index.php?lid=285377&query=18xgirls&
http://www.fusker.lv/index.php?lid=324500&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309937&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309936&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309934&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309902&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309901&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309900&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309899&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309898&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309897&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309896&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309894&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309893&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309892&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=309891&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=303254&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=303252&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=302396&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=265264&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=265260&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=265258&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=265257&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=265256&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=265251&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=262012&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=261857&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=261856&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=261844&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=258059&query=pheonixgirls&
http://www.fusker.lv/index.php?lid=258058&query=pheonixgirls&
Version: unspecified → 4.0 Branch
I will confirm this issue...

Windows 7 x64 w/ 8gb of ram.... firefox crashes when it hits 3.8... THREE POINT EIGHT gb's of ram
Firefox dies for me too.
Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110520 Firefox/6.0a1

But I'm not sure this is a real crash. The output when "crashing", when Firefox has been started from a shell prompt, is "Killed" and the Crash Reporter does not get activated.
OS: Windows XP → All
Hardware: x86 → All
I understand. If not a crash - what is the correct term for Firefox 4.0.1 using up all the system memory available then freezing and terminating, after which all of used up RAM is released back to the system? This termination is unique to Firefox 4.0.1, other browsers and even Firefox 3.6 can handle the links and do not terminate after opening the above posted links, clearly indicating there is a major flaw with Firefox 4 itself.
Tested on multiple systems, all running FF 4.01

q6600, 8gb RAM 7x64
q9550, 8gb RAM 7x64
i7-q720m, 6gb RAM 7x64

I can post crash reports to this thread if need be as well.

snippet from original test:
SystemMemoryUsePercentage: 88
Theme: classic/1.0
Throttleable: 1
TotalVirtualMemory: 4294836224
Vendor: Mozilla
Version: 4.0.1
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Tyler, bug 658594 has initial links that are wrong. Would you kindly delete bug 658594 and leave this one open because the links are correct on this one and they are incorrect on bug 658594
Status: RESOLVED → VERIFIED
No, there is no way to delete the bug, we can mark it a dupe of this one though.
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---
Verify this crashes it out as well.
Have you updated your graphics driver? can you disable hardware acceleration and see if you still get the crash?
Graphics driver updated, hardware acceleration disabled and problem replicated on Windows XP as well as Windows 7.

Note that every single person who has tried to crash Firefox 4 using the links above was successful in doing so. Firefox 3.6 does not crash using identical links. Neither do other browsers.
There's some information missing.  This was first reported as a memory leak:  bug 657759.  Note comments 2, which mentions difference in caching between version 3.6 and 4; and comments 3 and 4, which suggest that user may simply be exhausting all available memory resources.

Although there may be a valid issue with respect to how memory is used here, it's not necessarily a real crash.
Whiteboard: First reported as a memory leak, bug 657759
I thank the poster above for pointing out that there may be an explanation as to why Firefox 4 terminates after a moderate number of links above are opened whereas Firefox 3.6 does not terminate, whereas internet Explorer 6,7,8 and 9 do not terminate, whereas Google Chrome does not terminate when opening *the same* moderate number of links above.

Nevertheless, I submit that it should be our common goal to get Firefox 4 to be able to open approximately the same moderate number of links above as all the other browsers can.

Can other browsers open a *significantly* larger number of links above without terminating? Yes they can.
Summary: Major flaw: Firefox 4.0.1 can be crashed every time → Firefox crashes with many tabs and large images
The issue has not been resolved but it has been explained:

I modified the tests, they show that Firefox 4 releases used up memory three and a half minutes later. So you have to wait for three and a half minutes to be able to open more links. Other browsers release RAM within seconds. This is intentional: the creators of Firefox 4 think that this is better for a "typical Firefox user." 


So in a modern multi-tasking user environment, where you have say, a Blu-ray movie running on one screen or similar, well then you can only open a very limited amount of data in Firefox 4.

I managed to open only maybe 3 links before RAM usage was of concern and I have a 3GB RAM 4.0 GHz Intel i7 system. You have to wait for three and a half minutes before opening more.


So there it is - the issue is now explained and clear. It is up to the user to decide what to do. The topic has now moved to if there is a Firefox 4 configuration that would force it to release RAM like every other browser does. If not, people have Firefox 3.6 and then after that other browsers to go to when support for Firefox 3.6 ends.

I respectfully disagree that Firefox 4 is better set up this way. This explains why people are noticing more memory problems with Firefox 4. I don't know what this means for systems with less RAM, but the issue has been explained.
There's a report here:  http://forums.mozillazine.org/viewtopic.php?p=10826201#p10826201 of NO memory leak and NO crash.

(In reply to comment #16)
> I modified the tests, they show that Firefox 4 releases used up memory three
> and a half minutes later.

The memory manager should be robust enough to release memory if allocation fails.  If that's not happening, then that's the bug.
I wonder if playing with the image.mem.* Prefs makes a Difference and what in general the about:memory Output is ....
(In reply to comment #3)
> I understand. If not a crash - what is the correct term for Firefox 4.0.1
> using up all the system memory available then freezing and terminating,
> after which all of used up RAM is released back to the system? 

OOM
Summary: Firefox crashes with many tabs and large images → Firefox crashes with many tabs and large images causing OOM
Firefox eats much memory while loading all that images and uses up all memory, so the OS kills it. In comment 1, firefox may be killed because it reached ~4GB, which is a limit for memory allocations in 32bit applications? I think even 64bit Windows get 32bit firefox.

I confirm according to the comments.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: First reported as a memory leak, bug 657759 → First reported as a memory leak, bug 657759, [bugday-2011-05-27]
This sounds very much like a bug I submitted and can easily reproduce.  See bug 659220 for details.  I typically run Windows XP with 2GB and no swap file.  In this environment, Firefox 4.0.1 and 5.0b2 crashes quite frequently during normal usage, particularly with image heavy web sites.  This is unacceptable.  No other browsers crashes like this.  A well-designed application will invoke the garbage collector immediately when cache fills to reclaim unused memory, and only generate an OOM condition if memory is still unavailable AFTER the GC runs.  Firefox is not doing that, and I assert it's a major bug because people with low memory are going to see this quite a lot.
Blocks: mlk-fx4
Keywords: footprint
I've consolidated a number of bugs about image-heavy sites, including this one, into bug 660577.  Please CC yourself on that bug if you want to follow along.  Thanks.
Status: NEW → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → DUPLICATE
This issue should be helped by bug 573583. If people on this bug could test it by switching the image.mem.decodeondraw pref in about:config to true and reporting whether this helps the problem.
Tested solution which resolves this problem is:


1. type about:config in the address bar of Firefox 4

2. Scroll down to 
image.mem.min_discard_timeout_ms

3. Simply change the default value from 120000 to 10000


Tests show Firefox 4 will then release used up RAM back in seconds just like other browsers!
Resolution: DUPLICATE → WORKSFORME
Please leave as duplicate of 660577.  That's where the work is being done on this.
Resolution: WORKSFORME → DUPLICATE
You need to log in before you can comment on or make changes to this bug.