flukso/flm02

mosquitto memory leak, maybe halting flukso

Opened this issue · 2 comments

I am running v2-5-0 on a FLM022A and using mqtt locally.
Most remote capabilities are disabled manually (update + api).

I use MQTT in the local network to scrape data from the flukso. It works but after some hours
the flukso hangs and I need to unplug / reboot it.
Over time mosquitto seems to be eating more and more RAM without any apparent reason.
When it boots, there are roughly 4000k free and it shrinks over time due to mosquitto increasing it's data section:

while true; do cat /proc/774/statm; sleep 1; done

3748 2201 308 34 0 3125 0
3766 2212 308 34 0 3143 0
3766 2212 308 34 0 3143 0
3766 2212 308 34 0 3143 0
3766 2212 308 34 0 3143 0
3766 2212 308 34 0 3143 0
3766 2212 308 34 0 3143 0
3766 2212 308 34 0 3143 0
3766 2212 308 34 0 3143 0
3783 2222 308 34 0 3160 0
3783 2222 308 34 0 3160 0
3783 2222 308 34 0 3160 0
3783 2222 308 34 0 3160 0

I saw that several memory leaks were fixed in mosquitto since the version flm02 is using:
https://github.com/eclipse/mosquitto/blob/master/ChangeLog.txt
Upgrading to a recent version would maybe solve it. Does anyone know more?

I haven't gotten around yet setting up the toolchain to build images myself, so i cannot quickly try.

Last output before failure:

6250 3540 69 34 0 5627 0
             total         used         free       shared      buffers
Mem:         29452        28628          824            0          396
-/+ buffers:              28232         1220
Swap:            0            0            0
6250 3496 25 34 0 5627 0
             total         used         free       shared      buffers
Mem:         29452        28732          720            0          316
-/+ buffers:              28416         1036
Swap:            0            0            0
6265 3507 28 34 0 5642 0
             total         used         free       shared      buffers
Mem:         29452        28400         1052            0          416
-/+ buffers:              27984         1468
Swap:            0            0            0

Same output directly after boot, MQTT already working:

867 386 309 34 0 244 0
             total         used         free       shared      buffers
Mem:         29452        22620         6832            0         2640
-/+ buffers:              19980         9472
Swap:            0            0            0

Output generated with

cat /proc/$PID_OF_MOSQUITTO/statm
free

Fixed it temporary by adding

*/45 * * * * /etc/init.d/mosquitto restart

to the root crontab