Low usage RAM Ubuntu 22.04

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
Shaadow
Posts: 3
Joined: Thu Apr 28, 2022 9:39 am

Low usage RAM Ubuntu 22.04

Post by Shaadow »

Hello,

I wonder if my zoneminder is well configured.

ZoneMinder v1.36.15
Ubuntu
22.04

I have added 8 cameras, 4 of them record, the rest are monitored. The cameras are in 1080 and 720 quality.

ZoneMinder shows usage on /dev/shm at 3% with 8 GB RAM.

Is it normal? When changing the encode settings, the system is able to gradually use up all RAM and then reset the processes, this happens several times in a row. Before it starts working properly.
dougmccrary
Posts: 1216
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Low usage RAM Ubuntu 22.04

Post by dougmccrary »

/dev/shm had been using a big chunk of memory.
Newer versions use almost none of it.
I have more cameras than you and at 1%. Not sure what that is a % of.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Low usage RAM Ubuntu 22.04

Post by bbunge »

What you need to watch is the RAM used by the database server, MySQL or Mariadb. As the number of recorded events goes up the amount of RAM used by the database will go up. Mysqltuner can be installed and run from the command prompt for recommended changes to the config file. Usually the innodb_buffer_pool_size needs to be increased. Be careful here as increasing it too much can rob you system of needed memory.
aarons6
Posts: 38
Joined: Mon Feb 08, 2016 12:13 pm

Re: Low usage RAM Ubuntu 22.04

Post by aarons6 »

i noticed /dev/shm is not used much anymore.
i have 24gb of ram in my pc and /dev/shm was set to like 8gb of that ram with only 1% used.

i put an entry in fstab to fix this.
tmpfs /dev/shm tmpfs defaults,noexec,nosuid,size=5% 0 0

now my /dev/shm is around 1.2gb and its using about 30%.
this freed up a ton of system memory.

also i have 10 5mp cameras. with resolution 2560x1920 @ 10 fps.
User avatar
iconnor
Posts: 2906
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Low usage RAM Ubuntu 22.04

Post by iconnor »

We don't use as much shm as before. Still use ram, just not shm. shm is fixes, ram is dynamic.
Shaadow
Posts: 3
Joined: Thu Apr 28, 2022 9:39 am

Re: Low usage RAM Ubuntu 22.04

Post by Shaadow »

Thanks a lot to everyone for the answer.


In relation to the problem of the gradual wear of the entire RAM, I discovered that it was the fault of one of the cheaper camers. This camera consumed over 4GB of RAM and was able to loop strangely, using all available RAM on the server.

This camera made it difficult to use ZoneMinder. But there is also something else, because when switching from Video Wirter to encode with 4 cameras, the system suddenly starts using 100% of the CPU and taking up all the RAM until the reset. I tried to increase the Image Buffer Size and Maximum Image Buffer Size, but the changes did not help.
User avatar
iconnor
Posts: 2906
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Low usage RAM Ubuntu 22.04

Post by iconnor »

Sounds like a camera I am dealing with as well. No discernable keyframe interval (It's something over 500).

Your options are to either save jpegs instead of video writer, or use encode. You will have to configure the encoder though. Encoding is cpu-intensive although you can configure it to use an easier profile or maybe hardware accel is available to you.

You might just do jpegs though. Will take up more space but is easy.

In the end in order to deal with these cameras I think ZM will have to disassociate events from actual video storage. Basically just always record.
Shaadow
Posts: 3
Joined: Thu Apr 28, 2022 9:39 am

Re: Low usage RAM Ubuntu 22.04

Post by Shaadow »

When saving JPEGS instead of video writer, I have a problem with playing events. When I turn on an event from the website and try to rewind the recording, it suddenly ends. The same thing happens when I want to speed up the recording
Post Reply