You are reading a single comment by @Kolban and its replies. Click here to read the full conversation.
  • 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.


    1 Attachment

About

Avatar for Kolban @Kolban started