Memory leak in hardware type Domoticz - Remote Server Topic is solved

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
thelbekk
Posts: 14
Joined: Sunday 29 April 2018 12:42
Target OS: -
Domoticz version:
Contact:

Memory leak in hardware type Domoticz - Remote Server

Post by thelbekk »

Version: current HEAD of development branch
Platform: NetBSD/amd64-current
Plugin/Hardware: RFXCOM, OpenZWave, and Domoticz - Remote Server
Description:

I'm running two Domoticz installations, both currently running the very latest HEAD of development. The main one is on NetBSD/amd64-current, and the secondary on NetBSD/evbarm64-current. Each has RFXCOM and OpenZWave hardware adapters on USB, with a rather small number of devices behind them; about 20 ZWave devices and 10 4.33MHz devices on the main installation, and about 10 of each on the secondary one. The main one uses the Domoticz - Remote Server hardware type to connect to the secondary, and receive a feed of all its transactions.

And yes, OpenZWave. I'd like to move to the MQTT based setup, but I would have to port the ZWave part of that to NetBSD first, and haven't gotten around to doing more with that than just enough to realize that it'll take quite a bit of work.

I was running the very last commit before OpenZWave got removed until recently, and this memory leak was crashing domoticz on my main installation rather frequently, so when, over Christmas, I discovered that OZW had been taken back on board, I upgraded. That was completely painless, but the memory leak is still there.

When the remote connection is active, the main (receiving) system leaks memory continuously. I also see that if there is more activity at the remote, and thus more data being transfered, the leak is faster. We're talking about a gigabyte per day, even with this small installation being tapped. If I disable the remote connection, the memory usage of the main Domoticz instance immediately stops growing, and stays flat. When I re-enable it, the growth resumes. Eventually, the domoticz process gets a segfault and dies.

I've been reading the code in hardware/ASyncTCP* and hardware/Domoticz*, but haven't found anything that looks wrong. I have not studied the JSON code yet.

If anyone has any hints or ideas for me on how to proceed, I'd be very grateful!

-tih
thelbekk
Posts: 14
Joined: Sunday 29 April 2018 12:42
Target OS: -
Domoticz version:
Contact:

Re: Memory leak in hardware type Domoticz - Remote Server

Post by thelbekk »

Never mind - turns out the bug was elsewhere. :)

Not finding anything that looked fishy in the relevant Domoticz source code, I upgraded the OS to a newer snapshot, and it turns out the memory leak was a (now fixed) bug in a library.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests