-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Neolink Memory Leak / Errors #286
Comments
Well aware of this issue, (multiple open issues too) I've used valgrind, massif, and all sorts of other programs to track it. Can't seem to squash this one Also The program kind of works like this
Most of the apps memory allocations happen in the gstreamer part which I don't have direct control over. I'll keep looking when I can but nothing seems to be obvious |
Thanks for the reply! I really appreciate your work on this project. Sorry about the duplicate issue, I didn't see any other ones relating to this exact issue (but now that I went through the older issues, I see what you are referring to). I'm glad to hear that you're aware of the issue and trying to fix it, I know it's probably frustrating that you can't find the root cause. I'll keep monitoring issues with hopes of an eventual fix. As for the And as for the memory leak issue, I assume the only temporary fixes are just either allocating more memory and/or setting up automatic restarts every x hours? Thanks again for the help and work on this project! Let me know if there is any information that would be helpful for the debugging/troubleshooting process. |
I've seen memory leaks when running with 2 x RLC-CX810. If it helps troubleshooting, I've reverted back to |
For those using neolink in a docker configuration here is a docker compose work around for the memory leak: ...
neolink:
container_name: neolink
restart: always
deploy:
resources:
limits:
memory: 512M
image: quantumentangledandy/neolink
... also i came up with this quick bash script for restarting the container when the process itself takes up too much memory: #!/bin/bash
# The name of the Docker container
CONTAINER_NAME="neolink"
# Define the memory threshold (in percentage)
THRESHOLD=20
# Get the total system memory in kilobytes
TOTAL_MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}')
# Function to calculate the total memory usage of processes with the word "neolink"
get_neolink_mem_usage() {
ps aux | grep -i "neolink" | grep -v "grep" | awk '{mem+=$6} END {print mem}'
}
# Get the current memory usage of neolink processes
NEOLINK_MEM=$(get_neolink_mem_usage)
# Convert the memory usage to percentage
MEM_PERCENT=$(echo "$NEOLINK_MEM $TOTAL_MEM" | awk '{printf "%.2f", ($1/$2)*100}')
# Restart the Docker container if memory usage exceeds the threshold
if (( $(echo "$MEM_PERCENT > $THRESHOLD" | bc -l) )); then
echo "Memory usage of neolink processes is $MEM_PERCENT%, which exceeds the threshold of $THRESHOLD%"
echo "Restarting the Docker container $CONTAINER_NAME..."
docker restart $CONTAINER_NAME
else
echo "Memory usage of neolink processes is $MEM_PERCENT%, which is within the safe limit."
fi You could probably use a chron job to run this script every minute and that should also work. |
I switched to this Docker version, and while it did seem to be running pretty smoothly, it eventually crashed after 7-8 hours (I think it was a memory leak issue, but I wasn't monitoring it). Interestingly, I also received these errors right when the recording stopped. I haven't seen these messages before, so if anyone has any ideas of what they mean, I would appreciate the help.
|
Adding myself to the users who have this buffer problem. I run neolink with 5 cameras (B800 and D800) and can't get it to work properly with frigate. Main reason why I want neolink is that NVR doesn't provide Main stream for cameras via rtsp/https |
Edit: I did some more digging and realized that my PR just reverts an attempted fix from August 17 (so, after 0.6.3rc2). So it's unlikely to fix the underlying issues above, but if someone here (@federicotravaini?) happens to be running master, it might at least improve things. |
@QuantumEntangledAndy Andy -- could there be some sort of band-aid applied for this until the leak is resolved? Or, come at it from a different angle? For example --
This is a great project, but this problem is a show stopper. Countless hours of good work you and others have put into this project, to have this one thing make it nearly unusable! I mean, look at the graph jmoney shared a few posts above. He's having to restart the process every hour. I have a server with 512GB of RAM and Neolink will consume darn near all of it within 24 hours. It's real serious!! |
go2RTC will not work in the way that you seem to suggest. 1. It's written in go, so not directly integrate with this rust project, 2. it still requires the source to be in a somewhat usable format rtsp or rtp or something so gstreamer would still be required to handle it. Internally managing it is also not something I'd want to integrate, there are dedicated watchdog programs for such things |
I've been having similar problems with a Proxmox LXC docker container connected to one Lumus camera. Reading the comment by @RutgerDiehard above I thought I would give v0.6.0 a go. It's been running continuously for 12 hours with consistent output throughout. With the newer versions it was getting to 1GB within a couple of hours and continuing to rise. |
Describe the bug
This software is really amazing, but unfortunately I've been having a lot of issues with it, specifically with memory leaks. Memory usage is at 3.3G after just an hour. I have read a couple of the issues pertaining to memory leaks (like this one) and it seems like the main recommendation was to update. I updated a couple weeks ago (currently on b37b3ee release). Unfortunately, memory leaks continue and the logs are full of errors. I'm no expert at this stuff, so any help would be greatly appreciated.
Additionally, I checked today and saw a bunch of these errors:
To Reproduce
No specific steps to reproduce. I believe it has been happening since installation.
Expected behavior
No memory leaks (I would expect maybe 200-300MB of usage?).
Versions
NVR software: BlueIris v5.9.3.4
Neolink software: b37b3ee
Reolink camera model and firmware: 3 B800s -- Firmware on 2 of them is v3.0.0.82_20080600 and the other one is v3.0.0.183_21012800
The text was updated successfully, but these errors were encountered: