Page 1 of 1

Memory leak in blockly

Posted: Sunday 22 January 2017 9:40
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 2225 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 2225 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.

Re: Memory leak in blockly

Posted: Saturday 28 January 2017 7:00
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

Re: Memory leak in blockly

Posted: Saturday 28 January 2017 7:11
by pvm
The switches used in blockly, do they execute scripts on the on / off commands?

Re: Memory leak in blockly

Posted: Saturday 28 January 2017 17:28
by BP-GBW
hello, blockly scripts were running fine ! and of course executed on/off commands. regards

Re: Memory leak in blockly

Posted: Saturday 28 January 2017 21:44
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

Re: Memory leak in blockly

Posted: Monday 13 February 2017 3:05
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 2035 times
Keep running in lua only !

Re: Memory leak in blockly

Posted: Saturday 25 February 2017 3:01
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 1962 times

Re: Memory leak in blockly

Posted: Tuesday 28 February 2017 22:10
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

Re: Memory leak in blockly

Posted: Thursday 02 March 2017 14:53
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%.

Re: Memory leak in blockly

Posted: Thursday 02 March 2017 17:28
by mlamie
Interesting! Is there a developer who can look into it?

Re: Memory leak in blockly

Posted: Thursday 02 March 2017 17:41
by heggink
Giz is already engaged.

Re: Memory leak in blockly

Posted: Thursday 02 March 2017 20:59
by sincze
Story continues here I believe?
viewtopic.php?f=6&t=16367&p=122095#p122095