client:send("HTTP/1.1 200 OK\r\nContent-type: text/html\r\nConnection: close\r\n\r\n<!DOCTYPE html><head></head><body><p>Iterations: "..x.." Heap: "..node.heap().."</p><p>Version: "..a.."."..b.."."..c.."</p><script>setTimeout('location.reload();',300);</script></body></html>")
conn:on("sent", function() WiFiclose() end)
function WiFiclose() conn:close() collectgarbage() print(node.heap()) end
Run this on your ESP device and enter the IP address into your browser (it doesn't care what file you are accessing). You will see that 0.9.6 starts at around 27K and stabilizes at around 24K. In my case, 2.0.0 starts at around 37K and decreases at a rate of about 200 bytes per iteration until it crashes at around 3K. I noticed that if I increase the delay before reload to about a second, 2.0.0 will stabilize at around 4K and not crash. This implies that the garbage collection is not aggressive enough. I haven't tried this on any other versions, since I don't have a build environment. Perhaps this can be as simple as upping the garbage collection priority.