Latest version appears to have a memory leak?
Latest version appears to have a memory leak?
Memory slowly climbs and I have to have a cronjob reboot the machine roughly every 12 hours. Is this a known issue?
-
- Posts: 1314
- Joined: Sat Aug 31, 2019 7:35 am
- Location: San Diego
Re: Latest version appears to have a memory leak?
Pretty much, yes. Unless it got much worse for you the last few builds. Been a problem since 1.34 - code name The Memory Remains
Re: Latest version appears to have a memory leak?
There are no known memory leaks.
Every time I dig into one of these reports I find that the machine is under-spec'd and the user is ignoring their logs.
It is frustrating for everyone.
The most recent report, the user had a large pre-event-count. 150. Larger than the maximagebuffers count. So the poor machine was simultaneously trying to buffer 150 frames at 4k image resolution, and also trying to limit the buffer to something less than that. So now we have an error message when you try to create a situation like that.
What are you ImageBufferCount, MaxImageBufferCount and Pre_eventCounts set to? What is happening in your logs? What is the resolution of the camera? Are you recording all the time or just on motion?
Every time I dig into one of these reports I find that the machine is under-spec'd and the user is ignoring their logs.
It is frustrating for everyone.
The most recent report, the user had a large pre-event-count. 150. Larger than the maximagebuffers count. So the poor machine was simultaneously trying to buffer 150 frames at 4k image resolution, and also trying to limit the buffer to something less than that. So now we have an error message when you try to create a situation like that.
What are you ImageBufferCount, MaxImageBufferCount and Pre_eventCounts set to? What is happening in your logs? What is the resolution of the camera? Are you recording all the time or just on motion?
Re: Latest version appears to have a memory leak?
The logs are clean, nothing but INF.
I've tweaked the buffer counts many times to lock in a decent memory level, and it runs just fine for many hours, recording sometimes hundreds of events, but if I were to generate a graph of memory usage it'd climb slowly but inexorably. I don't see any reasonable explanation for that which wouldn't involve a leak. The memory usage starts out around 20%, hits 80% or so after 10 hours, and I just have it reset every 12 hours to keep it back under control.
I've got 5 cameras streaming at 1080p, my ImageBufferCount is 3, Max is 200, pre is 20. I've set the Max lower, it results in the memory starting out lower which buys me a bit more runway, however it still runs over eventually. I'm recording on motion.
I'm using a raspberry pi 5, 8gb.
I've tweaked the buffer counts many times to lock in a decent memory level, and it runs just fine for many hours, recording sometimes hundreds of events, but if I were to generate a graph of memory usage it'd climb slowly but inexorably. I don't see any reasonable explanation for that which wouldn't involve a leak. The memory usage starts out around 20%, hits 80% or so after 10 hours, and I just have it reset every 12 hours to keep it back under control.
I've got 5 cameras streaming at 1080p, my ImageBufferCount is 3, Max is 200, pre is 20. I've set the Max lower, it results in the memory starting out lower which buys me a bit more runway, however it still runs over eventually. I'm recording on motion.
I'm using a raspberry pi 5, 8gb.
Re: Latest version appears to have a memory leak?
Side note: the error message about max needing to be more than pre seems to demand a 10x more. For example, if I want a pre of 20 I actually have to set the max to 200. I don't know why it's not just a simple > rather than >10x?
Re: Latest version appears to have a memory leak?
screenshot of error at 190 over 20.
Re: Latest version appears to have a memory leak?
getting ahead of a probable future question/concern: this is a freshly imaged raspberry pi with nothing else installed on it besides zoneminder, so I find it unlikely any other process is causing the gradual memory creep.
I just installed atop (the first non zoneminder related apt install ), I can produce a report of memory usage over time once it's gathered data for a while.
I just installed atop (the first non zoneminder related apt install ), I can produce a report of memory usage over time once it's gathered data for a while.
-
- Posts: 1314
- Joined: Sat Aug 31, 2019 7:35 am
- Location: San Diego
Re: Latest version appears to have a memory leak?
Just a note - if you were running anything less than 1.37.60, what I said before was sorta true for me. But yesterday's .60 seems better. I'm about to get today's .60.