Memory leak?

Support and queries relating to all previous versions of ZoneMinder
Locked
CX23882-19
Posts: 15
Joined: Sun Jul 08, 2007 7:57 am

Memory leak?

Post by CX23882-19 »

I checked my ZM server this morning and found it running extremely slowly and upon going to Webmin I found that it had used all 3GB physical memory and almost 2GB of virtual memory. Restarting Apache and ZoneMinder brought it back down to normal.

What is the best way of identifying (in the future) the runaway process - either Apache or Zoneminder?
Flash_
Posts: 441
Joined: Wed Jan 11, 2006 12:19 pm

Post by Flash_ »

free shows memory, but read wikipedia as it's not as straight forward as windows. Linux will use all memory where it can, allocating as cache and buffers. If you want a nice graphical representation, install munin and wait a few hours for it to propogate. That makes it easy to show how memory is split between the types of processes, but not individual ones.

top and htop show memory usage by process.

Zoneminder, apache, mysql are all mature programs used very widely and they don't have inherent memory leaks - although it is possible there is something unique to your setup that is causing something.
sabaspistceak
Posts: 1
Joined: Tue Mar 15, 2011 7:52 am
Location: Finland
Contact:

re:

Post by sabaspistceak »

+1
CX23882-19
Posts: 15
Joined: Sun Jul 08, 2007 7:57 am

Re: Memory leak?

Post by CX23882-19 »

It must have just been a one-off event that upset something. I hadn't seen it occur before and I haven't seen it happen since - virtual memory usage has been at 0 bytes for the past week (as it usually is on this system).
CX23882-19
Posts: 15
Joined: Sun Jul 08, 2007 7:57 am

Re: Memory leak?

Post by CX23882-19 »

I've run into this problem again, for the past two days.

It is Apache which is using up all the memory (both times, there were two Apache processes, one with a ridiculous amount (several GB) of memory, and the other with a reasonable hundred MB. All it is doing is serving Zoneminder across my local network, so there is no valid reason for it to be using so much memory.

After it misbehaved yesterday, I restarted Apache. 24 hours later and it had eaten all memory again.

Currently running ZM 1.24.2 on Ubuntu 10.04.
vraa
Posts: 31
Joined: Mon May 23, 2011 6:28 am

Re: Memory leak?

Post by vraa »

Unused ram = wasted ram

http://www.linuxatemyram.com/
CX23882-19
Posts: 15
Joined: Sun Jul 08, 2007 7:57 am

Re: Memory leak?

Post by CX23882-19 »

I appreciate your reply but that is not the problem here.

Apache is using up ALL the physical RAM in the system (4GB), and THEN using up the available swap space (3GB), to the detriment of everything else on the system (the whole system slows to a crawl). The system is practically unusable until Apache is killed off.

There is no way that Apache needs that amount of RAM in any case. This is a home system with probably 1 user at a time, running a simple Zoneminder install. We have IIS serving Drupal to a whole organisation and it's using less memory than this. Under normal circumstances each Apache process is around 140MB. When this problem occurs, there will be one process using in the order of 5GB, with all others at 140MB.

I wouldn't mind if the memory was being used for filesystem cache, or indeed anything useful. It isn't, Apache is misbehaving.

Are there any suggestions for working out what is causing Apache to start eating all my memory?
vraa
Posts: 31
Joined: Mon May 23, 2011 6:28 am

Re: Memory leak?

Post by vraa »

post your apache.conf

what's your maxclients set to?
Locked