lenkf
Posts: 19
Joined: Wed Jul 10, 2013 10:02 pm
Location: S.California

Motion and Firefox memory leak

Sat Aug 31, 2013 10:07 pm

I setup a MS LifeCam HD3000 on a rev B rpi. It works decently well with the motion program. I currently stream 800x448 (modulo 16 safe) images of my outdoor aviary to home network and on the internet. While viewing the stream with Firefox 23, my 2 windows 7 PCs would sometimes crash after viewing for a while. Investigation with Task Manager and Resource Monitor on PC showed a chunk of memory was used up for every frame displayed in FF and wasn't returned to Windows OS. Eventually there's no "free" or "available" memory.

Memory leaks with FF have been a problem for a long time, but even current FF v.23.0.1 leaks memory when viewing mjpegs. The only way to recover memory is to close FF. To make sure I don't crash my Windows PCs, I set the motion.conf file webcam_limit to 180 frames, or about 3 minutes at 1 frame/sec. (I also observed iceweasel loosing memory on the rpi.) This works on my 2G netbook and 4G laptop.

see https://bugzilla.mozilla.org/show_bug.cgi?id=858615 for FF memory leak bug info.

fred

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Motion and Firefox memory leak

Tue Sep 10, 2013 2:36 pm

Sorry, just to be certain, this is a wider issue with firefox outside of the pi concerning mpeg streams?
Dear forum: Play nice ;-)

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Motion and Firefox memory leak

Tue Sep 10, 2013 2:42 pm

What code are you using to render the images inside Firefox??

Richard S.

lenkf
Posts: 19
Joined: Wed Jul 10, 2013 10:02 pm
Location: S.California

Re: Motion and Firefox memory leak

Thu Sep 19, 2013 3:31 pm

Sorry for late response. Still learning how to use the forum. Firefox is known for memory leaks. The Mozilla crew keep working on it. There's even some Firefox add-ons designed to recover lost memory, but 2 i tried didn't work on Win7 computer while viewing Motion frames sent from the pi.

Not sure what function in Firefox is used to view Motion's little webserver sending mjpeg MIME type frames.

If you use a Windows PC, run Firefox to view 208.127.177.81:8081 as an example of a Motion webcam. Open Task Manager on the PC and select the Performance tab. Observe the Free memory go down by 1 or 2 Mb for each frame delivered. Memory will be restored once you leave the site above or close Firefox.

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Motion and Firefox memory leak

Thu Sep 19, 2013 4:06 pm

If this is a known bug to firefox, happening on a windows PC, I'm not quite sure why you posted to the R-Pi troubleshooting section as this is not an issue isolated to the pi. Unless I'm missing something (and if I am by all means, please expound ;-) ) I'll move the topic to the general or off topic subform.
Dear forum: Play nice ;-)

Oakham
Posts: 366
Joined: Tue Aug 20, 2013 9:11 pm

Re: Motion and Firefox memory leak

Thu Sep 19, 2013 4:11 pm

I was under the impression Raspbian Wheezy offers the IceWeasel browser not Firefox ?
Searching is easy, most questions have been asked before !

lenkf
Posts: 19
Joined: Wed Jul 10, 2013 10:02 pm
Location: S.California

Re: Motion and Firefox memory leak

Sun Oct 06, 2013 8:34 pm

Yes this is a bug (tho little understood apparently by Mozilla) in Firefox (or iceweasel for rpi). I mentioned it in this forum originally because some new users (like me) may think the problem is associated with the rpi or the motion program, and wonder what they are doing wrong on the rpi. Indeed, I've seen a couple posts on the rpi.org regarding locked up PCs while viewing a webcam with Firefox.

Sorry, I should have framed my first comment more precisely.

Fred

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Motion and Firefox memory leak

Mon Oct 07, 2013 3:25 pm

No it's fine, I was just trying to figure out if it belonged here in the troubleshooting section (which is supposed to be for issues isolated only the Pi, but with so many people posting basic linux questions it's hard to keep it in line :lol: )
Dear forum: Play nice ;-)

Return to “General discussion”