Apache Leak Memory with ZoneMinder

Support and queries relating to all previous versions of ZoneMinder
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

That is not an Apache memory leak, but a Firefox memory leak. Firefox is a pig. Still looking for a leaner alternative, but dillo is non-functional with ZM.
walawala
Posts: 5
Joined: Tue Jan 29, 2008 8:24 pm

Switching from nph-zms to zms worked for me.

Post by walawala »

Often, when I opened the monitor window, there would just be a little picture-placeholder-icon that Firefox shows before it's loaded an image.
To see the picture, I would have to refresh the window once or twice.
Every time I refreshed the monitor window, a new nph-zms process would start, but the previous one would usually stick around taking up memory.

This seems to have fixed the problem for me:
In the options/paths/ZM_PATH_ZMS field, I changed from the default "/cgi-bin/nph-zms" to "/cgi-bin/zms".

After making this change, I also found that I didn't need to refresh the monitor window at all. It may just be my imagination, but it seems like it's streaming a little faster now. :D

Just thought I'd add this here since I found this solution in an unrelated thread.

I'm using GNU/Linux 2.6.22-14
Ubuntu Gutsy Gibbon
Firefox 2.0.0.11
and ZM v. 1.22.3
walawala
Posts: 5
Joined: Tue Jan 29, 2008 8:24 pm

On second thought...

Post by walawala »

I fixed my problem as I mentioned above, but looking closer, I see that firefox (and I think all gecko browsers) have the same problem.

The monitor window I had open shows two cameras and the firefox (and other gecko-based browsers) started eating up about 1/10 MB per second.

That memory was only reclaimed when the browser was completely shut down (not just the monitor window).

One browser I tried, "kazehakase" also worked and the memory was reclaimed when the monitor window was closed without closing the main window. Still, I need to have the monitor window open almost all of the time, so I'm looking for an alternative like maybe a dedicated viewer program for ZM.
walawala
Posts: 5
Joined: Tue Jan 29, 2008 8:24 pm

One more note..

Post by walawala »

It seems to fix the firefox-slow-memory-leak problem if in Firefox you go to "about:config" and set "browser.cache.memory.enable" to false.
User avatar
jacomoman
Posts: 23
Joined: Thu Jan 17, 2008 9:25 pm
Location: Silicon Valley, CA

Works for me

Post by jacomoman »

walawala, it doesn't sound like my setup is so different from yours but the nph-zms processes work fine for me when I open/close monitor windows. I've sat and watched "top" and it shows the nph-zms processes come and go as I open and close the monitor windows. And I'm not talking about having to close all browser windows either, just the video monitor windows.

Like you I'm also using FireFox 2.0.0.11, with ZM 1.22.3 installed. I even tried it with IE 6 and same results. nph-zms processes come and go as expected. Of course with IE you must have the cambozola.jar in your web dir for the streaming server to start, otherwise you only get still pictures.

Jac
:)
walawala
Posts: 5
Joined: Tue Jan 29, 2008 8:24 pm

Post by walawala »

@jacomoman:
I'm using Apache ver. 2.2.4-3bui (according to aptitude)
Is that what you're using?
User avatar
jacomoman
Posts: 23
Joined: Thu Jan 17, 2008 9:25 pm
Location: Silicon Valley, CA

Post by jacomoman »

Mine's even older:

Code: Select all

[root@vidserv ~]# apachectl -v
Server version: Apache/2.0.52
Server built:   Jan  5 2006 12:31:31
walawala
Posts: 5
Joined: Tue Jan 29, 2008 8:24 pm

Post by walawala »

It's possible a bug crept in somewhere between Apache releases ;)
But I'm not ruling anything out just yet. Still, changing from nph-zms to zms seems to have fixed my problem.
naelr
Posts: 2
Joined: Thu Mar 06, 2008 11:34 pm

Post by naelr »

First off I am new to the forums and have been playing with several versions of zoneminder for about 3 months now. I bought the pr149 card from Bluecherry and I love what features Zoneminder has to offer. Well done everyone awesome software.

I have used 1.22.x that comes on the live cd.. I have used the bluecherry xubuntu cd and the version that comes on it and I have installed a clean ubuntu server 7.10 and complied 1.23.2 from source and on all occasions I have this same memory issue that everyone has reported. If I just have 4 cameras all running at 320x240 and all on monitor all my memory doesn't fill up. If I put just one of the cameras on Mocord (the feature I love the most second to the video exporting) all free ram on the machine will get used. I don't even need to have the console open.. If i reboot the server (no gui installed) and log in a few hours later via ssh or at a console and run top all 1 gig of memory is used up. 95% of the memory is used with zma or zmc processes. Right now all 4 cameras are on Mocord and all 4 zma processes are at
Virt Res Shr
133m 11m 10m

and all 4 zmc processes are at
Virt Res Shr
140m 28m 26m

So far this hasn't caused me any issue I just noticed this thread and wondered if these figures/information might help someone.

Love the software and keep up the good work.
Naelr
Locked