Lua build 20141222 uses more heap
Posted: Wed Dec 24, 2014 5:13 pm
Hi,
I have a script that works in build 20141219 but not 20141222, trying to load the script (dofile) causes a node restarts in the new build. I noticed that there is only 18096 heap space free (node.heap()), I had ~20k free in the previous build.
The script has ~140 lines with 9 functions, as I mentioned before, dofile causes a node restart. The strange thing is that if I break the file in 2 files, one with 114 lines and 6 functions (initial-setup.lua, see below) and the other with 49 lines and 3 functions (string-functions.lua, see below), I can load the files in order (the large file must be loaded before the small one, otherwise the node restarts):
The other problem that I have, is that calling functions would result in a node restart as well (note that this works in build 20141219 ). I am suspecting that the node is running out of heap, but I am not sure. IS the node heap usage increase expected in this new build (20141222), or was it an oversight (bug)?
2- Are there any instructions to how setup the development environment to build the nodemcu (https://github.com/nodemcu/nodemcu-firmware)?
Thanks,
/N
I have a script that works in build 20141219 but not 20141222, trying to load the script (dofile) causes a node restarts in the new build. I noticed that there is only 18096 heap space free (node.heap()), I had ~20k free in the previous build.
The script has ~140 lines with 9 functions, as I mentioned before, dofile causes a node restart. The strange thing is that if I break the file in 2 files, one with 114 lines and 6 functions (initial-setup.lua, see below) and the other with 49 lines and 3 functions (string-functions.lua, see below), I can load the files in order (the large file must be loaded before the small one, otherwise the node restarts):
Code: Select all
print(node.heap())
18096
> dofile('initial-setup.lua')
> print(node.heap())
7216
> dofile('string-functions.lua')
> print(node.heap())
3544
the size of files are:
initial-setup.lua size: 3051
string-functions.lua size: 1265
The other problem that I have, is that calling functions would result in a node restart as well (note that this works in build 20141219 ). I am suspecting that the node is running out of heap, but I am not sure. IS the node heap usage increase expected in this new build (20141222), or was it an oversight (bug)?
2- Are there any instructions to how setup the development environment to build the nodemcu (https://github.com/nodemcu/nodemcu-firmware)?
Thanks,
/N