Memory leak in blockly

Moderator: leecollings

Post Reply
BP-GBW
Posts: 12
Joined: Wednesday 04 December 2013 16:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Memory leak in blockly

Post by BP-GBW »

pi
v.3.5877
rfxco
m

From years, i have a memory leak which need to reboot 1 time per month. Not a big deal. nothing in the logs.
I have decided to test by slowly deactivate all equipments, script (lua, etc.) and service.
I have detected that the source are in 4 blockly scripts. Set then inactive stop the leak.
chart(2).png
chart(2).png (70.98 KiB) Viewed 2223 times
I have two class of blockly scripts and 2 scripts in both class.
My blockly scripts are roughly all the same : they implement energy tuning consumption.
First class is : Test the temperature of a room (oregon) over threshold and if we are not in "vacancy" modes (virtual switch) or "turbo" (virtual switch) send a command to a DIO equipment to put on economy the electrical heat. (cf capture). I have 2 blockly script like this.
Capture d’écran 2017-01-22 à 01.29.17.png
Capture d’écran 2017-01-22 à 01.29.17.png (28.17 KiB) Viewed 2223 times
Second class with 2 scripts is more simple and consists to test the temperature of the room and if the DIO equiment is ON (electrical heat) set the DIO equipment to OFF.


I am currently testing the two class of blockly scripts to be more accurate.

regards.
BP-GBW
Posts: 12
Joined: Wednesday 04 December 2013 16:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Memory leak in blockly

Post by BP-GBW »

hello,

Blockly Script of class 1 have created the memory leak. I translated blockly into lua and the leak has disappeared. easy.
I did not try to test further like by removing the 'virtual sensor' to emulate a 'turbo' states for instances.
best regards
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: Memory leak in blockly

Post by pvm »

The switches used in blockly, do they execute scripts on the on / off commands?
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
BP-GBW
Posts: 12
Joined: Wednesday 04 December 2013 16:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Memory leak in blockly

Post by BP-GBW »

hello, blockly scripts were running fine ! and of course executed on/off commands. regards
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: Memory leak in blockly

Post by pvm »

These commands have not changed while moving to LUA?
You've performed a good detailed analysis. I just do not understand the leak in blockly
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
BP-GBW
Posts: 12
Joined: Wednesday 04 December 2013 16:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Memory leak in blockly

Post by BP-GBW »

hello,
I only translate from blockly to lua keeping the commands to the DIO of course. The solution ran perfectly without leak (see Jan 25th-> Feb 4th). Then, i have tried to move back in order to handle the leak. Surprisingly, first results without virtual sensor (class 2) makes leak coming back (note it is in contradiction to first experimentation-class 2 scripts was supposed to be ok). I duplicate the same scripts (class 2) 10 times and leak don't increase. I did not understand :?: .
Blockly Scripts like if TEMP >=thresh and DIO(equip)=off then DIO (equip) =ON introduce memory leak on my configuration.
chart(3).png
chart(3).png (101.06 KiB) Viewed 2033 times
Keep running in lua only !
BP-GBW
Posts: 12
Joined: Wednesday 04 December 2013 16:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Memory leak in blockly

Post by BP-GBW »

hello, finally i found. any blocks with blockly with commands introduce a memory leak. I have started to write some tests that set on and off sensor Two symmetrical scripts has been used . In 5 hours i have used all the memory of the PI.
[attachment=1]Capture d’écran 2017-02-2 ... ttachment]
chart(4).png
chart(4).png (68.47 KiB) Viewed 1960 times
Attachments
Capture d’écran 2017-02-25 à 02.50.17.png
Capture d’écran 2017-02-25 à 02.50.17.png (18.79 KiB) Viewed 1960 times
User avatar
heggink
Posts: 980
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Memory leak in blockly

Post by heggink »

I have a LOT of blocky's and run out of memory after about 7-8 days. Seems like it may be the same issue.
Have you made any progress? Did you report this as a bug?
Thanks!
Herman
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
heggink
Posts: 980
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Memory leak in blockly

Post by heggink »

Saw yr bug report. Replacing all my blockies with lua scripts ensured that the system is now stable at 3.6% mem use over the past 24 hrs. Normally, it would have increased by 10%.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
mlamie
Posts: 122
Joined: Friday 25 October 2013 17:12
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5877
Location: The Netherlands
Contact:

Re: Memory leak in blockly

Post by mlamie »

Interesting! Is there a developer who can look into it?
Raspberry Pi 3, RaZberry, RFXtrx433
Various Z-Wave devices, KlikAanKlikUit devices, ESP8266 NodeMCU, Sonoff POW and a Essent E-thermostaat
IP camera: Dahua 4MP IPC-HDBW4421R-AS, Vivotek FD8134V
User avatar
heggink
Posts: 980
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Memory leak in blockly

Post by heggink »

Giz is already engaged.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Memory leak in blockly

Post by sincze »

Story continues here I believe?
viewtopic.php?f=6&t=16367&p=122095#p122095
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest