Closed Bug 608552 Opened 9 years ago Closed 9 years ago

HTML5 video tag has memory leak when playing multiple videos in a loop


(Core :: Audio/Video, defect, major)

Not set





(Reporter: troelsh, Unassigned)



(1 file)

User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:2.0b6) Gecko/20100101 Firefox/4.0b6
Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0b6) Gecko/20100101 Firefox/4.0b6


I am working on a implementation on html5's video tag to create a player that can be used as a sort of digital signage solution. Only problem is after aproximately 1-2 hours of continuous play my 2gbyte ram is filled and firefox exits with a dull: Out of memory error.

I think the problem is related to the fact that firefox does cache of all the videos. But it does not check to see if the video is already in the cache. If it does it has memory leaks and the cache just keeps expanding til it hits the systems limit.

Disabling cache in about:config does not help.

Reproducible: Always

Steps to Reproduce:
1. get some ogv files theora/vorbis encoded ofc.
2. create an array in javascript with the files in it and use the video.onended function to load the next and the next and so on.
3. Wait as the Ram usage clime until firefox crashes as it reaches the system limit.
Actual Results:  
Firefox crashed saying: out of memory

Expected Results:  
FF should clear out cached video on the fly or at least there should be a way of asking FF to not cache videos.

I do not have the use of seeking in the video's hence cache is not a problem just need the next couple of minutes of video in the cache.

See attachment for code example.

For me it's a major feature that is broken, maybe you think it otherwise.
Code to reproduce problem
Maybe i should also mention that this is running under Ubuntu 10.10 on a 2.6.35-22-generic linux kernel.
Component: General → Video/Audio
Product: Firefox → Core
QA Contact: general →
I can't reproduce this on Fedora Core 12 x86 or on Ubuntu 10.04 x86 (both in VMWare Workstation). Admittedly I didn't wait around for 2 hours, but memory use seems stable. Are you able to post a link to a complete testcase that reproduces the problem?
How many different video clips have you used for your test? There is a steady incline en memory consumption when i use arround 5 different video clips. I will see if i can setup a test site somewhere that i can link to..

If i use big clips like 30mins long the leak is more significant.

I have tested this under x86 ubuntu 10.10 on two machines. I will also try to replicate it under a different operating system.
Okay, I have a test setup the videos are released under a free license so i hope i don't step on somebody's toes by using them in this test.

The server will be running for the next 48hours or so.

 2625 root      20   0 48964  35m 9664 S   60  1.8  42:19.78 Xorg
 4667 xxxx      20   0 1644m 1.3g  31m S   37 64.1  28:48.03 firefox-bin
I think this is solved in FF 4b prerelease 8?! I have not been able to reproduce it in that version.
(In reply to comment #7)
> I think this is solved in FF 4b prerelease 8?! I have not been able to
> reproduce it in that version.

Great, if you have problems again, please file a new bug! Thanks!
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.