-->
Page 1 of 5

Lua build 20141222 uses more heap

PostPosted: Wed Dec 24, 2014 5:13 pm
by NaAl
Hi,
I have a script that works in build 20141219 but not 20141222, trying to load the script (dofile) causes a node restarts :cry: 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 allprint(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

Re: Lua build 20141222 uses more heap

PostPosted: Wed Dec 24, 2014 7:21 pm
by sej7278
nobody can get it to build properly using linux/mac with the xtensa toolchain - well its builds but bootloops whenever you use the file() functions etc.

zeroday uses the xp virtual machine from espressif, which seems to use the old xtensa tarball (here) plus a couple of missing simcall-* files, not the newer one used by the gcc crosstool-ng toolchains like esp-open-sdk or the wiki.

we really need to move away from using the espressif makefiles, vm's, etc. to something more maintainable.

Re: Lua build 20141222 uses more heap

PostPosted: Thu Dec 25, 2014 5:50 am
by zeroday
NaAl wrote:Hi,
I have a script that works in build 20141219 but not 20141222, trying to load the script (dofile) causes a node restarts :cry: 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 allprint(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


heap remain:
~20k, build 20141219, based on sdk 0.9.2
~18k, build 20141222, based on sdk 0.9.4
no api changes.

sdk 0.9.4 has some new features.(which not wrapped in lua yet, like RTC)

Re: Lua build 20141222 uses more heap

PostPosted: Thu Dec 25, 2014 5:54 am
by zeroday
sej7278 wrote:nobody can get it to build properly using linux/mac with the xtensa toolchain - well its builds but bootloops whenever you use the file() functions etc.

zeroday uses the xp virtual machine from espressif, which seems to use the old xtensa tarball (here) plus a couple of missing simcall-* files, not the newer one used by the gcc crosstool-ng toolchains like esp-open-sdk or the wiki.

we really need to move away from using the espressif makefiles, vm's, etc. to something more maintainable.


-ng toolchain build a firmware with 2k ram less than the old xp vm. ( that's why I stick to the old one ),
It would be great if someone can figure out where is the 2k ram gone.