-
-
Notifications
You must be signed in to change notification settings - Fork 50
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.
|
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: