-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZMC high ram and not clearing when events created #3414
Comments
Thanks for opening your first issue here! Just a reminder, this forum is for Bug Reports only. Be sure to follow the issue template! |
Same problem here. Cant use Mocord. 30seconds after activation no memory left on device |
Same problem here. It was fine on 1.34 but 1.36 is exhausting my system RAM after some time. |
I think I'm seeing this as well; or at least similar. I have my buffers set to a hard limit (which I've been gradually increasing) currently at 300. |
I'm seeing the same issue. I have multiple cameras that should stay around 18 to 22 GB of memory usage but after about 30 minutes of starting Zoneminder, all of my memory is completely filled and spills into swap. This is true if I limit the buffer or set it to 0 for unlimited. This is also true if I give the server 32 GB of ram or 128, Zonminder takes it all regardless. |
Lots of graphs and such but not a single log file. One of you will have to send a debug level 3 log. |
@connortechnology How large do you want the log? |
@connortechnology 11 hours of level 3 debug logs came to just over 18 GB of loggy goodness. Where would you like me to send it? |
@connortechnology You're going to have to gunzip this.. but... here ya go... https://www.dropbox.com/s/maaqjrht2gsoapg/extra_debug_level_3.log.gz |
I have the same problem. My limited workaround is to set the max buffer size for each stream. This goes against the claim that Zoneminder will only ever use 1/2 of the available system RAM. It does not - it will use it all up until the server starts killing off zmc tasks. |
@Fl1pp3d0ff that log shows motion detection is not keeping up. You do not have the cpu to handle that high res camera. You have set it to use 24bit mode, which saves some ram, but at the cost of not being able to use SSE or other optimized instructions. Switch it to 32bit. Also, don't do analysis on every frame, you just can't keep up. Set an analysis fps of 2 or 3 fps. |
@connortechnology Interesting.. The CPU usage on that VM with 14 vCPUs assigned to it rarely, if ever, runs above 50%... |
Yeah - changing between 24 / 32 bit did not help my system. Again - my work around was to change the max buffer size. Per the zoneminder documentation I shouldn't have to do this - and I didn't have to do it before this update. Zoneminder docs claim that it will never use more than half of the available system RAM. It uses all of it. My /dev/shm/ remains low through all of this as well. I'm not a new user. I've been using zoneminder for over a decade. This is the first time this has happened. |
I've changed the VM slightly... I've set up CPU passthru and assigned 12 threads (Xeon X5690 CPUs, so.. plenty of horsepower to do the job...) of direct host CPU to the VM. I've set all 10 monitors to 32-bit color and I've also moved the analysis down to 5 FPS on all monitors. The memory is still filling then crashing then filling then crashing. |
Had the same problem, trying 1.34 right now. |
i have the same problem wirh zm 1.36.19 on vmware's VM, with only one monitor |
I've given up on solving this - it seems the dev is more interested in blaming everything else than fixing this issue. I tested it on FreeBSD as well - same issue. |
Hi, I had pretty much the same problem with ZM 1.36, here is how I solved it according to my need (v.1.36.17 as of now, did not have time to update to the latest). RAM was filling up with just one 1080p camera, no matter how much RAM was allocated to the VM.
As stated in the dummies guide, It is recommended to record 2 streams: https://wiki.zoneminder.com/Dummies_Guide#Motion_Detection So I ended with the following setup:
It is only possible to live view the stream1 in the interface, however live view the stream 2 would be useless. I have been testing this for several weeks, RAM usage on the VM (OS+ZM) is stabilized to around 1.40 GB and I use zoneminder-base docker images.
What saved me was to disable "Save JPEGs" under Storage tab for the high res stream. As I read in different threads this feature implementation changed a bit between version 1.34 and 1.36, but I am not able to explain in detail :). I hope these details will be helpful. |
While I also see the OOM_KILLER every now and then your situation seems to be radically worse than mine. For comparison, here's the week (average) graphs for my installation (7 cameras, 16 monitors, 7 monitors low-res on modetct, 7 monitors full-res (1920*1080) on nodect, 2 monitors inactive waiting for camera #8) running on a container with 8GB RAM/512MB swap/8 cores (X5675@3.07GHz). Just like you I'm using Debian, Zoneminder version 1.36.12-bullseye1 While I have fewer cameras than your installation (7 instead of 10) I have more monitors (16 instead of 10) running in ⅕ of the memory, 1/96 of the swap and close to ½ of the core count. The main difference is the use of modect on the low-res streams and nodect on the high-res streams from the same cameras and the fact that I'm using a container instead of a VM. As said I do see the occasional runaway zmc process but as the graphs already show this does not happen all that often. I also have some problems with cameras which just quiet sending data (unrelated to ZM) which I solved with a watchdog script which resets zombie cameras. Maybe you can try the low-res modect/high-res nodect approach to see whether that solves this issue? You can also check whether using a container instead of a VM makes a difference (unlikely but worth exploring). This installation has been in use for about 1.5 year running ZM 1.34, then 1.36, without problems (other than the mentioned occasional runaway zmc process). I do have live-streaming enabled on the high-res monitors since the cameras are also used for monitoring purposes. |
I have the same problem. It was working fine on 1.34. Working fine for many years prior. The instant I upgraded to 1.36 I started having serious memory problem. No other configuration changes were made. |
perhaps you didn't read the release notes. You should change your ImageBuffers to something like 3. Or 5 if live viewing a little stuttery. |
if you mean me, my image buffer size = 3 and always has been. |
Can you provide a link to the release notes? |
https://github.com/ZoneMinder/zoneminder/releases/tag/1.36.0 Of course the problem here is that was a long time ago and that line should have been in bold and caps and all that. Anyways, I've seen a lot of people say that 1.34 worked great and while doing support diagnosing a problem I see that their system has been screaming at them that there is something wrong and they just ignored it. So it's complicated. 1.36 CAN use a lot more ram than 1.34 because 1.34 used fixed buffers and 1.36's grow as needed (hence the MaxImageBuffer setting). We also buffer when writing to disk, so if disk is slow, then buffers fill up. Same with writing to the db. @basildane we are going to need a lot more info about your system. |
Seeing this after upgrading to v1.36.17. Restarting ZM recovers the memory. |
I had the same issue after upgrading to 1.36. So followed the advice from [jeje42] by creating the linked monitor at lower resolution for analysis. |
What I've found is it's vastly worse (or maybe only) for cameras with zones defined. Trying to reduce my zones to see if it improves. |
I seem to have fixed this on mine. |
Thanks "MoHf7f4" everything seems to be working so far. |
Describe Your Environment
If the issue concerns a camera
N/A
Describe the bug
If you have a monitor on MOCORD and the monitor detects an event, RAM usage increases and does not decrease when the event ends. I have tried to limit image buffer size to 100 frames to stop ZMC filling RAM but this results in "queue is full" errors in logs. My keyframe interval for my camera is set to 15frames(1 Second) and I'm recording in 4k.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
This will cause RAM usage to increase and not clear over time(it does decrease slightly). The RAM usage seems to only increase when the event is longer than the previous one.
Debug Logs
Packet queue error
RAM increase with no max buffer size
![1](https://user-images.githubusercontent.com/48514138/151054694-e20554aa-f2c2-4962-a395-f53a798181c0.PNG)
1 Event RAM increase
2 Events RAM increase
![2](https://user-images.githubusercontent.com/48514138/151054696-27bf9927-3a1c-4663-a978-c02e821e2cf2.PNG)
3 Events RAM increase
![3](https://user-images.githubusercontent.com/48514138/151054698-5134ad04-5903-4214-8a76-6202937d7a77.PNG)
After a few minutes RAM stays roughly constant
![after a few mins](https://user-images.githubusercontent.com/48514138/151055248-1477b383-b6e7-478b-b771-9bad213cc433.PNG)
The text was updated successfully, but these errors were encountered: