void handleRoot() {
digitalWrite(led, 1);
server.send(200, "text/plain", "hello from esp8266!");
digitalWrite(led, 0);
Serial.print("Heap: ");
Serial.println(ESP.getFreeHeap());
}
Open http://192.168.whatever in your browser and press "update" or whatever really reloads your webpage. I get something like this:
Heap: 28792
Heap: 27984
Heap: 28144
Heap: 28592
Heap: 28168
Heap: 27784
Heap: 27384
Heap: 26976
Heap: 26600
Heap: 26480
Heap: 26040
Heap: 25904
Heap: 25448
Heap: 25288
Heap: 24880
Heap: 25008
Heap: 24760
Heap: 24880
Heap: 24488
Heap: 24096
Heap: 24168
Heap: 23752
Heap: 23592
Heap: 23176
After some time, heap is at about 600 still going down, than watchdog reboot.
Any ideas?