Comments (7)
This issue is ancient, but I fixed a memory leak related to connections closing in rtl_tcp
in my fork: https://github.com/benschumacher/rtl-sdr/tree/rtltcp_memory_leak
This has been submitted as a PR to the upstream project: pinkavaj/rtl-sdr#5
from rtlamr.
Are you killing the rtl_tcp instance between executions of rtlamr as well?
from rtlamr.
No. I start rtl_tcp as a service at boot, and let it continue to run.
raspberrypi:/etc/init.d> more rtltcpd.sh
#!/bin/bash
# /etc/init.d/rtltcpd.sh
### BEGIN INIT INFO
# Provides: rtl_tcp for automatic meter reading
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This service is used to manage rtl_tcp
### END INIT INFO
case "$1" in
start)
echo "Starting rtl_tcp"
/usr/local/bin/rtl_tcp >/dev/null 2>&1
;;
stop)
echo "Stopping rtl_tcp"
killall rtl_tcp
;;
*)
echo "Usage: /etc/init.d/rtltcpd.sh start|stop"
exit 1
;;
esac
exit 0
raspberrypi:/etc/init.d>
from rtlamr.
Before I get too far into this could you tell me if the memory usage remains the same after killing rtl_tcp once free memory has gotten low from running rtlamr multiple times?
I suspect that rtl_tcp isn't cleaning up it's thread/linked-list appropriately when the worker thread exits, and this may be due to rtlamr not closing the connection politely. It's extremely unlikely that rtlamr itself has a memory leak since go is garbage collected, I have very little control over what stays in memory while it is running and I'm not doing anything unsafe that the garbage collector couldn't handle.
from rtlamr.
I have included a log of running rtlamr multiple times until the memory gets fairly low. I execute free after every run. At that point, I find the process for rtl_tcp, and kill it. I then execute free again, and it looks like all the memory has been returned.
from rtlamr.
I've confirmed that rtlamr is closing it's connection to rtl_tcp appropriately and the leak exists in rtl_tcp. I'll take a look at filing a bug report for rtl_tcp but for the time being I'm closing this issue.
In the meantime, you'll want to kill and restart rtl_tcp once every several rtlamr executions.
Another option would be to figure out which frequencies your meter operates on and set the center frequency appropriately as well as shortening the symbol length to 8. On most electric meters this will produce a reading once every 25 minutes and require minimal cpu resources.
from rtlamr.
Thank you for your dedication and hard work to this project.
from rtlamr.
Related Issues (20)
- RTL_TCP quits HOT 6
- ITRON 40G - Unable to find meter or no messages? HOT 1
- Poor R900 message reception except with msgtype=all HOT 1
- SCM+ Endpoint ID HOT 1
- r900Parser.filter / quantize takes over 80% of CPU HOT 3
- Is it possible to support G5R1s? HOT 1
- Leak fields HOT 1
- panic on startup HOT 5
- All fcc.io device links return "Internal Server Error - Read" HOT 2
- Notice: Support for X meter?
- R900 meters may need additional decoding? HOT 2
- Filter based on tamper flags or type HOT 1
- Would this work for water meters with UI-1203 protocol?
- Itron 500G stopped working HOT 2
- R900 with "Leak": 15 and "LeakNow": 3 flags HOT 1
- Old R900 reader addon hooked up to 5/8" Neptune Aquity t-10 - readings HOT 3
- can't read itron cl200 c1sr (fcc sk9c1a-3b) HOT 1
- Sorry for being dense, but is consumption coded or something? HOT 1
- Itron 100WD HOT 2
- Documentation clarification request: Handling spread spectrum HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtlamr.