Hi.
I'm new to NodeMCU, ESP8266 and Lua so this report may be wrong. Tell me if it is, i will close it.
I was testing TCP server and noticed memory leak.
NodeMCU custom build by frightanic.com
branch: master
commit: b96e31477ca1e207aa1c0cdc334539b1f7d3a7f0
SSL: false
modules: adc,bit,cjson,crypto,dht,file,gpio,net,node,pwm,tmr,uart,wifi
build built on: 2017-02-14 22:26
powered by Lua 5.1.4 on SDK 2.0.0(656edbf)
Calculating time i got about 2 minutes. So after closing connection memory is "reserved" for about 2 minutes.
After searching something related to it i found this:
https://github.com/espressif/ESP8266_RTOS_SDK/blob/master/include/espressif/espconn.h#L534bit 0: 1: free memory after TCP disconnection happen need not wait 2 minutes;
I'm not completely sure what is this but as i understand it is some espconn_set_opt function inside ESP8266.
Searching this repository i found espconn_set_opt is mentioned
https://github.com/nodemcu/nodemcu-firmware/search?utf8=%E2%9C%93&q=espconn_set_opt
But as i understand it is not used anywhere in the code.
Is there way to access it?
Or maybe we can have that opt bits in net.createServer(type, timeout) as third parameter like net.createServer(type, timeout, opt)?
Hi. I'm new to NodeMCU, ESP8266 and Lua so this report may be wrong. Tell me if it is, i will close it. I was testing TCP server and noticed memory leak.
Hardware
ESP-12-E
Software
I built mine NodeMCU online at https://nodemcu-build.com/ I used integer: http://nodemcu-build.com/builds/nodemcu-master-13-modules-2017-02-14-22-27-27-integer.bin Load output is:
I got HTTP server example code from here: http://nodemcu.readthedocs.io/en/dev/en/
Problem
Holding Ctrl+R in web browser causing crash with out of memory reason. I modified code like that:
and holding Ctrl+R causes this:
After investigation i found something. If i do about 150 requests and wait some time i will get this:
Calculating time i got about 2 minutes. So after closing connection memory is "reserved" for about 2 minutes. After searching something related to it i found this: https://github.com/espressif/ESP8266_RTOS_SDK/blob/master/include/espressif/espconn.h#L534
bit 0: 1: free memory after TCP disconnection happen need not wait 2 minutes;
I'm not completely sure what is this but as i understand it is some espconn_set_opt function inside ESP8266. Searching this repository i found espconn_set_opt is mentioned https://github.com/nodemcu/nodemcu-firmware/search?utf8=%E2%9C%93&q=espconn_set_opt But as i understand it is not used anywhere in the code. Is there way to access it? Or maybe we can have that opt bits in net.createServer(type, timeout) as third parameter like net.createServer(type, timeout, opt)?