-->
Page 1 of 1

"Out of memory" : the final solution

PostPosted: Fri May 26, 2017 6:37 am
by MaxItaly
After a lot of test about the "Out of memory" issue, this's my final solution:
1 - use the firmware "dev"
2 - when possible declare the variable "local" and destroy it after used with "nil"
3 - for large string use the "table" and manage with table.remove, table.concat, ...
4 - compile the script to .lc to save memory and increase the speed of execution
5 - ! THE MOST IMPORTANT ! split the code in several script according to their function. Load with dofile(.....)
when is needed.
Now my webserver (about 500 lines) work correctly with the memory heap about 20000.
Thanks
Max :D

Re: "Out of memory" : the final solution

PostPosted: Fri May 26, 2017 8:45 am
by marcelstoer
Glad it works out for you. Are you aware of our FAQ that covers this topic in detail: https://nodemcu.readthedocs.io/en/lates ... -footprint