I built a new set of firmware using the latest code base ... attached is the new trace and memory usage. It looks like the changes made by @Gordon seem to have saved 180 blocks.
Will upload a new binary/firmware set for the ESP8266 now.
As for the "missing" 17K ... ...
After booting with Espruino - free heap = ~5K
Known JsVars = 1024*x 16 = ~16K
Total known = 16K + 5K = ~21K
ESP8266 Booted with no firmware but WiFi and TCP = ~40K
Un-accounted for RAM = 40K - 21K = ~19K
My first impression is ... and this is a guess ... that String constants are placed in RAM. So if in C we code:
char *x = "hello";
or
if (strcmp(x, "hello")) ...
Then the string constants eat RAM. I am "guessing" that some large portion of the missing RAM is used by strings.
For example, I looked at jsinteractive.o uses 2100 bytes and jsparse.o uses 1900 bytes and there are likely other hitters out there too. I don't know enough to know if static character string can be moved to flash or instruction RAM but I'm going to guess not.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I built a new set of firmware using the latest code base ... attached is the new trace and memory usage. It looks like the changes made by @Gordon seem to have saved 180 blocks.
Will upload a new binary/firmware set for the ESP8266 now.
As for the "missing" 17K ... ...
After booting with Espruino - free heap = ~5K
Known JsVars = 1024*x 16 = ~16K
Total known = 16K + 5K = ~21K
ESP8266 Booted with no firmware but WiFi and TCP = ~40K
Un-accounted for RAM = 40K - 21K = ~19K
My first impression is ... and this is a guess ... that String constants are placed in RAM. So if in C we code:
or
Then the string constants eat RAM. I am "guessing" that some large portion of the missing RAM is used by strings.
For example, I looked at
jsinteractive.o
uses 2100 bytes andjsparse.o
uses 1900 bytes and there are likely other hitters out there too. I don't know enough to know if static character string can be moved to flash or instruction RAM but I'm going to guess not.1 Attachment