Memory leak somewhere?

Current Development version likely to have breaking changes
Post Reply
keyboardgnome
Posts: 63
Joined: Sat Apr 08, 2006 10:18 pm

Memory leak somewhere?

Post by keyboardgnome »

Howdy do!

I'm currently running 1.37.6~20220105164932-focal, but have noticed this behavior for prior releases in the dev branch over the last couple months, but it feels like there's a memory leak somewhere and I'm not sure how to troubleshoot it.

The longer (a couple days at a time) I run zoneminder without restarting it, the more ram get's allocated and chewed up (128 Gigs) for a dedicated ZM box. When it starts off, it's happily using about 18Gigs for at least a day, and then after a day more and more gets used up.

Any thoughts or suggestions as to what I can do to try and collect some data to find out where the leak may be? Currently, debug doesn't show any dying process, and it doesn't seem like anything is "flapping."

Fairly soon, just to be able to log into the box, I may have to have a nightly cron restart the process.
dougmccrary
Posts: 1172
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Memory leak somewhere?

Post by dougmccrary »

Yes, it's been worse, getting better.
That's why the release is called what it's called....

You may also notice it starts using swap real fast, and never seems to release it.
Pjoms
Posts: 12
Joined: Fri Jan 14, 2022 12:05 pm

Re: Memory leak somewhere?

Post by Pjoms »

Hello!
I have experienced the same thing.
In my case, it seems that I may have found a useful workaround by setting "Maximum image buffer size (frames)" under Buffers in camera settings to a fixed value for all cameras.
I have to set it to around 100 to not get any errors regarding full queue, but the memory usage is right now 43% (of 8GB) and the swap 53% (of 512MB).
I have at the moment three HD-cameras running with dual streams (main+sub) running in a Proxmox container.
User avatar
iconnor
Posts: 2879
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Memory leak somewhere?

Post by iconnor »

The analysis process can take a long time starting events, during which time the packetqueue can grow and grow and sometimes analysis never catches up.

In 1.37.7 we are experimenting with more threads to manage this. So far it seems to be working well. Might get merged to 1.36.13.

In the meantime, as mentioned above, set a MaxImageBuffer size to keep it from running away.
Post Reply