Increasing usage of RAM memory

Discussions related to the 1.36.x series of ZoneMinder
mendozaLt
Posts: 20
Joined: Wed Jul 13, 2022 3:05 pm

Increasing usage of RAM memory

Post by mendozaLt »

Zoneminder slowly eats my server memory... I have to restart it at least once a day to get back to sane memory usage. Is there anything i can do to stop it stealing RAM? If i would not restart it it would probably go to the point where server starts choke, lag and restart...

When i restart it:
image_2022-07-13_171214072.png
image_2022-07-13_171214072.png (8.42 KiB) Viewed 3863 times
After few hours:
image_2022-07-13_170951718.png
image_2022-07-13_170951718.png (7.52 KiB) Viewed 3863 times
User avatar
Andyrh
Posts: 243
Joined: Sat Oct 28, 2017 3:55 am

Re: Increasing usage of RAM memory

Post by Andyrh »

Is it actually causing a problem? You say it might cause a problem. My 16GB system is currently running with 851MB free. It has been up 17 days.
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
cookiemonster
Posts: 32
Joined: Sat Aug 15, 2015 1:46 pm

Re: Increasing usage of RAM memory

Post by cookiemonster »

Hi. It's well worth checking the FAQs if you haven't tried already https://zoneminder.readthedocs.io/en/stable/faq.html
mendozaLt
Posts: 20
Joined: Wed Jul 13, 2022 3:05 pm

Re: Increasing usage of RAM memory

Post by mendozaLt »

It's currently 56 Gb (to be upgraded), and its not only to zm, there is a lot other guys, that would like to get some ram... And it only three cameras...
User avatar
Andyrh
Posts: 243
Joined: Sat Oct 28, 2017 3:55 am

Re: Increasing usage of RAM memory

Post by Andyrh »

On my 6 camera system there is not much 'free' RAM, but there is plenty of available RAM.

@watcher:~$ free -m
total used free shared buff/cache available
Mem: 15912 10015 982 468 4914 5091
Swap: 4095 1995 2100
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
mendozaLt
Posts: 20
Joined: Wed Jul 13, 2022 3:05 pm

Re: Increasing usage of RAM memory

Post by mendozaLt »

Andyrh wrote: Wed Jul 13, 2022 4:00 pm On my 6 camera system there is not much 'free' RAM, but there is plenty of available RAM.

@watcher:~$ free -m
total used free shared buff/cache available
Mem: 15912 10015 982 468 4914 5091
Swap: 4095 1995 2100
When i restart zm, i also have plenty of available, but few hours later zm occupies most of it...

Approx an hour ago, when i posted this question, it was:
image_2022-07-13_171214072.png
image_2022-07-13_171214072.png (8.42 KiB) Viewed 3856 times
Now:
image_2022-07-13_180834940.png
image_2022-07-13_180834940.png (7.77 KiB) Viewed 3856 times
Numbers are not scary YET, but with this speed, tomorrow morning i will have redline on my webmin memory gauge...
User avatar
Andyrh
Posts: 243
Joined: Sat Oct 28, 2017 3:55 am

Re: Increasing usage of RAM memory

Post by Andyrh »

I should have mentioned that is after 17 days.
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Increasing usage of RAM memory

Post by Magic919 »

It’s what it does. Hopefully it’ll be fixed one day.
-
User avatar
iconnor
Posts: 2879
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Increasing usage of RAM memory

Post by iconnor »

We need to narrow down what your monitors are doing. I have had other reports of this but no amount of valgrind has shed any light.

So what are they doing? ffmpeg type? modect, mocord, etc? camera passthrough or encoding? jpegs? Is there a large number of events during the time when the ram increases?
mendozaLt
Posts: 20
Joined: Wed Jul 13, 2022 3:05 pm

Re: Increasing usage of RAM memory

Post by mendozaLt »

Two monitors Modect, one Monitor (does not record).
I haven't changed anything much far from default...
image_2022-07-13_201220067.png
image_2022-07-13_201220067.png (36.55 KiB) Viewed 3838 times
image_2022-07-13_201317292.png
image_2022-07-13_201317292.png (26.12 KiB) Viewed 3838 times
image_2022-07-13_201409169.png
image_2022-07-13_201409169.png (20.74 KiB) Viewed 3838 times
mendozaLt
Posts: 20
Joined: Wed Jul 13, 2022 3:05 pm

Re: Increasing usage of RAM memory

Post by mendozaLt »

Not so much events... 45 - 50 per hour, and they are short...
Attachments
image_2022-07-13_202506212.png
image_2022-07-13_202506212.png (75.9 KiB) Viewed 3838 times
image_2022-07-13_202331746.png
image_2022-07-13_202331746.png (27.33 KiB) Viewed 3838 times
image_2022-07-13_202255434.png
image_2022-07-13_202255434.png (18.08 KiB) Viewed 3838 times
User avatar
iconnor
Posts: 2879
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Increasing usage of RAM memory

Post by iconnor »

Okay you are writing jpegs... I had a case yesterday where a machine was not keeping up due to writing jpegs.

Are there warnings in your logs? Is the timestamp keeping up?

I'll set one of my cams to jpegs and see if I can reproduce it.
mendozaLt
Posts: 20
Joined: Wed Jul 13, 2022 3:05 pm

Re: Increasing usage of RAM memory

Post by mendozaLt »

iconnor wrote: Wed Jul 13, 2022 6:28 pm Okay you are writing jpegs... I had a case yesterday where a machine was not keeping up due to writing jpegs.

Are there warnings in your logs? Is the timestamp keeping up?

I'll set one of my cams to jpegs and see if I can reproduce it.
Which exactly log file should i check? But anyway, there is nothing much wrong in the logs... Just some of these:

Code: Select all

07/13/22 21:05:21.692011 zms_m4[1854890].WAR-zm_monitorstream.cpp/425 [Frame send time 7785 msec too slow, throttling maxfps to 20.00]
07/13/22 21:07:33.929069 zms_m4[1857833].WAR-zm_monitorstream.cpp/412 [Unable to send stream frame: Broken pipe]
07/13/22 21:08:23.843189 zms_m4[1858259].WAR-zm_monitorstream.cpp/412 [Unable to send stream frame: Broken pipe]
User avatar
iconnor
Posts: 2879
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Increasing usage of RAM memory

Post by iconnor »

I found a memleak and have fixed it. Do you want to update to my proposed ppa and test it?

sudo add-apt-repository ppa:iconnor/zoneminder-proposed
sudo apt-get update
sudo apt-get install zoneminder

Should get you a 1.36.21 version although packages are building now and I can't guarantee when they will be available.
mendozaLt
Posts: 20
Joined: Wed Jul 13, 2022 3:05 pm

Re: Increasing usage of RAM memory

Post by mendozaLt »

I would, i tried...

Code: Select all

E: The repository 'http://ppa.launchpad.net/iconnor/zoneminder-proposed/ubuntu k                                                                                                                                                             inetic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disa                                                                                                                                                             bled by default.
N: See apt-secure(8) manpage for repository creation and user configuration deta                                                                                                                                                             ils.
root@server:~# apt-get install zoneminder
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
zoneminder is already the newest version (1.36.20-bullseye1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Post Reply