Page 1 of 1

/dev/shm usage growing for no reason

Posted: Tue Oct 03, 2017 3:11 pm
by xxrb2010

I installed zm 1.30.4 on a clean RHEL 7 and put only one high def camera for testing purposes yet. This machine is only running ZM and some RHEL monitoring tools. I have a 4TB/8GB machine with 3.6Gb for tmpfs and after a clean reboot and clearing of all event, /dev/shm is at 18% usage. Over the life of the server, the usage can growth up to 100%.

I tried to understand why the usage of /dev/shm is growing from the forum but did not find anything related to my issue. My issue might be a user error or newbie error. I wonder whether events use /dev/shm?

Thanks for any explanation

Re: /dev/shm usage growing for no reason

Posted: Tue Oct 03, 2017 5:37 pm
by iconnor
/dev/shm use should not grow. It can grow a bit if zmc is crashing. Check your logs.
Also be aware that other things use /dev/shm too. Do an ls -la /dev/shm to see what. ZM's files all start with zm.
Another thing to do is
lsof | grep DEL | grep shm
To see what files are deleted but still there.

Re: /dev/shm usage growing for no reason

Posted: Tue Oct 03, 2017 7:11 pm
by xxrb2010
thanks for your input iconnor,

I did have a lot of crashes the last few days, as I am testing many parameters. Since my last reboot, I got the /dev/shm going up to 41% with a streaming live windows active, but it went back to 23% when I closed it.
So far, I have only zm.nmap.1 and zmswap-m1 in this space with the former taking 99.99% of the used space and with no file deleted and still there.

Will continue watching it, but looks like crashes was the reasons. I am feeling better as I will add 5 more high def camera and only 8 Gb more ram.

Re: /dev/shm usage growing for no reason

Posted: Tue Oct 03, 2017 9:05 pm
by knight-of-ni
When zoneminder streams a live view to a client, it buffers jpgs (default is up to 1000 jpgs) into the swap folder, which is often /dev/shm since that gives the best performance.

You can expect a typical h264 1080p camera, with a ring buffer of 30, to consume almost 300MB (277MB by my experiment), just to give you an idea of what kind of overhead capacity you need.

So yes, your /dev/shm consumption will increase while you are live streaming. When the stream closes, the files will be deleted.

If there is a crash or any kind of abnormal termination during a live stream, files could certainly be left behind.

Re: /dev/shm usage growing for no reason

Posted: Wed Oct 04, 2017 5:00 pm
by xxrb2010

I think this is what happened, I do lot of live streaming (32 bit colors 2000x3000 something pixels, 4K) so a lot of /dev/shm usage :), and I have zm crashed many times with all my testing.

Now this is much more smooth and the usage is constant.

Thanks for all the feedback,

To the developers, the product looks really great, everything so far works as advertised :), event the emailing alerts.