As the title says... Chat on...

User avatar
By NullPointer
#61500 Well, it is the heap. My one hour of monitoring wasn't enough (looked stable). What is odd is that there are large drops every couple of hours or so.

I am not accumulating data on it, just posting a string every 30 seconds. I am going to make certain I'm not doing something stupid with the variables, I'll report back if I find a module is leaking or more likely I'm not understanding how to make sure the heap can be freed.

Image
http://imgur.com/a/3vB8C
Last edited by NullPointer on Wed Jan 25, 2017 1:41 pm, edited 1 time in total.
User avatar
By NullPointer
#61510 Found the issue.

Code: Select all200 POST http://myserver/
{"name": "NodeMCUi", "status": "good", "posts": 36, "sensordata": "22.125,1,3032,21704", "sensordefn": "temperature,switch,voltage,heap", "upsince": 636209247233129853}
200 POST http://myserver/
{"name": "NodeMCUi", "status": "good", "posts": 37, "sensordata": "22.1875,1,3032,21704", "sensordefn": "temperature,switch,voltage,heap", "upsince": 636209247233129853}
HTTP client: Disconnected with error: -11
HTTP client: Connection timeout
HTTP client: Connection timeout
{"name": "NodeMCUi", "status": "good", "posts": 38, "sensordata": "22.125,1,3032,20904", "sensordefn": "temperature,switch,voltage,heap", "upsince": 636209247233129853}
200 POST http://myserver/
{"name": "NodeMCUi", "status": "good", "posts": 39, "sensordata": "22.1875,1,3032,21112", "sensordefn": "temperature,switch,voltage,heap", "upsince": 636209247233129853}
200 POST http://myserver/


If the http module experiences loss of connectivity, the node loses some heap. I was able to verify this with "myserver" logs and also watch it happening via a serial monitor. The third item in "sensordata" JSON above is the heap, repeated disconnection errors from HTTP client seems to be causing the heap loss.

I don't know if switching to the net module instead will help, though I have done. Going to run another long test and see if the same thing happens. I'd post a bug report to GitHub but I see there is already one open from a few days ago on this exact topic.
User avatar
By NullPointer
#61518 I appreciate that marcelstoer, I'll set up a test of the http module with server connection failure so that it is independently verifiable.