"Out of memory" : the final solution
Posted: Fri May 26, 2017 6:37 am
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
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