QuantumEntangledAndy / neolink

An RTSP bridge to Reolink IP cameras
GNU Affero General Public License v3.0
383 stars 50 forks source link

Potential memory leak #202

Open Dinth opened 11 months ago

Dinth commented 11 months ago

Describe the bug Hi. I might have found a memory leak, but apologies - i am not really able to provide more details, been dealing with an IT disaster at home and my only access to the docker machine is via Java client connected to iDRAC. During last night, my pfSense died, together with DHCP server.

I can only provide some screenshots, as my docker machine lost dhcp lease and its offline. Screenshot from 2023-12-10 12-06-57

Neolink logs - hundreds of screens of this: image

Versions NVR software: Frigate Neolink software: (apologies, currently my docker machine is down, but its latest docker image as of 9/12/2023, maintained by watchtower)

Dinth commented 7 months ago

Pulled a new image (quantumentangledandy/neolink:latest) yesterday and after ~20h the container is a 400MB memory usage. Still feels a bit high for what it does, but the actual leak appears to be gone. Great work and thanks for investing so much time and effort into this 🥳

My understanding is that the fix is currently only in test/valgrind branch and will be merged to the :latest only after some testing. Try the test branch, but you can replace the default command with the command from the :latest branch to prevent auto restarts

QuantumEntangledAndy commented 7 months ago

It's actually in both. Since it was an identifiable bug and I felt it should be released to fix issues with those on docker:latest, it's not in a release yet though, so no versions number for it yet .

fleaz commented 7 months ago

That's what I assumed after checking the commit history, therefore I pulled ":latest" which is by (my) definition always current main branch and not current release.

And otherwise I would be really surprised why the leak is gone, when the change would not be in this image haha :D

Pytonballoon810 commented 7 months ago

@QuantumEntangledAndy I have now tried the neolink:test-valgrind image for 2 weeks and havent had a memory leak issue since. I would say it works

pr0phe commented 7 months ago

So the leakege is fixed for docker release? @QuantumEntangledAndy When regular version will be fixed 2?

QuantumEntangledAndy commented 7 months ago

You can pull latest versions from the actions tab in github and finding one from CI workflow, for example this one https://github.com/QuantumEntangledAndy/neolink/actions/runs/8934277800 builds are made for EVERY push

QuantumEntangledAndy commented 7 months ago

At the moment I am addressing issues with pause and VLC, I reduced the buffer size and it seems to not be enough for some clients to determine the stream type before the pause. So want to fix that before a realease

Pytonballoon810 commented 2 months ago

I whiped up something quick for those wanting to use neolink without having to babysit it consistantly: https://github.com/QuantumEntangledAndy/neolink/issues/286#issuecomment-2359137521

just make sure you set "restart: always"