Memory is filled linearly in a short time

Forum for questions and support relating to the 1.24.x releases only.
Locked
Andre81
Posts: 14
Joined: Thu Jun 25, 2009 10:25 am

Memory is filled linearly in a short time

Post by Andre81 »

Hi @ all,

I've a virtual machine Ubuntu 10.10 64bit running ZM 1.24.2
I'have 2 cameras with resolution 1280x800 (Axis M3014) but in the html page I've set to working @ 640x480 and all working fine.

When I go in the hypervisor control, I can see that the memory of my virtual machine is filled and stay fill all the time...

When I reboot the system I can see this:

Image

and after a bit of time I can see that the memory is filled linearly:

Image


Image

this is confirmed use the free command

Code: Select all

andrea@camera-server:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          1497        851        646          0         56        578
-/+ buffers/cache:        216       1281
Swap:          387          0        387
andrea@camera-server:~$
after a bit of time

Code: Select all

andrea@camera-server:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          1497       1304        192          0         85        964
-/+ buffers/cache:        254       1242
Swap:          387          0        387
andrea@camera-server:~$

and here my ipcs -l output

Code: Select all

andrea@camera-server:~$ ipcs -l

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 1500000
max total shared memory (kbytes) = 1536000
min seg size (bytes) = 1

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

------ Messages: Limits --------
max queues system wide = 2989
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384

andrea@camera-server:~$  
Why my memory is filled up?

Thanks Andrea
Andre81
Posts: 14
Joined: Thu Jun 25, 2009 10:25 am

Post by Andre81 »

up
clipo
Posts: 101
Joined: Sat Sep 06, 2008 9:55 am
Location: Manchester, UK
Contact:

Post by clipo »

From my basic understanding of ZM it fills the memmory with its buffer images before and during analysis then if needed will write it to disc.

So judging by the resolutions your using the memmory requirement will be fairly high, try stopping ZM and see if the memmory if free'ed up after.
Flash_
Posts: 441
Joined: Wed Jan 11, 2006 12:19 pm

Post by Flash_ »

Welcome to linux memory management.

Code: Select all

andrea@camera-server:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          1497        851        646          0         56        578
-/+ buffers/cache:        216       1281
Swap:          387          0        387 
The second line - + cache, shows linux is using the spare unused memory as cache. 1281 is actually cached and available for apps. The really big performance impact comes if swap starts to be used.

To get a more understandable view, run htop - or even better, install munin and get some pretty graphs like this.

This is a typical zoneminder machine of mine and as you can see, linux leaves only a little 'unused' memory (the red) but quickly fills the rest with cache (purple). There's a lot of good info on the web about linux memory management but the big difference from windows memory is that linux makes use of unused memory wherever it can, but should that memory be required for apps it'll dump the cache and free it up.

I picked this one since it was rebooted halfway and you can see the memory being cached after that spike.

Image
Andre81
Posts: 14
Joined: Thu Jun 25, 2009 10:25 am

Re: Memory is filled linearly in a short time

Post by Andre81 »

Great reply!!

Thanks for the information.

A.
Locked