Thor77 / Blueproximity

Run a command once a bluetooth device is in/out of a range
GNU General Public License v2.0
66 stars 15 forks source link

excessive memory consumption #43

Open Thor77 opened 8 years ago

Thor77 commented 8 years ago

proximity.py is consuming 4 GB of the 12 GB RAM on this system.

Ubuntu 10.04.1 blueproximity 1.2.5-4 up 48 days x86_64 Intel Xeon CPU W3540

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
30533 me 20 0 4431m 4.0g 9476 S 6 33.9 323:33.41 python /usr/share/blueproximity/proximity.py

valgrind tells me that hcitool leaks 24 bytes each time it returns "Read RSSI failed: Input/output error" but I don't think this happens often enough to account for the 4GB even if python's child reaping is somehow broken. Does anyone have suggestions of where to look?

The consumption of 2 pids every second for the sh -c hcitool rssi <mac> is kinda noisy. How much work would it be to use python-bluez for the rssi query?