ESP8266 Memory Usage

debugGlen Cook has just made a neat little utility for checking the amount of RAM in Eclipse projects…  here’s the output – and there’s a link below – contact Glen, not me for more info.

Part of the problem of working with new processors – is understanding what is being used and where.  I look forward to seeing a visual version of this with used RAM, FLASH etc. and showing what’s used and what’s left. It would not be the first time I’ve run out of RAM.

Also linked to on my ESP8266 Facebook page.

Does anyone know the significance of the IRAM (initialised RAM) as in one project I’m down to 800 bytes – while having 38K of general RAM left.

10 thoughts on “ESP8266 Memory Usage

  1. Downloaded it, no instructions!

    I tried to work it out from your screenshot, no joy. I compiled 2 of the espressif examples, hello_world and esphttpd, and no objdump or app.out files to be found 😦

      • Hi Glen Thanks for your input.

        I have found the app.out file in the hello_word build folder, and httpd.out in the esphttpd build folder.
        BUT no signs of any form of dump file, other than the one in the xtensa folder.

  2. SOrry Glen, I did think of moving the lot to one of my hosted WordPress setups which has much better commenting than this crap – but I’d lose all my Google street cred.

  3. OK, the top line of the app requires the location of the objdump tool, click on the text box and browse to the location of the tool. This location will be remembered between restarts, and should never change. This xtensa tool is used for creating the data in order to determine the memory map of your code.

    The second line of the tool requires the location of the app.out file, this will be in a different directory for each project. It wont change location for a project though.

    Pressing the process button will use the tool you’ve located in the top text box (this wont change) to extract information from the file in the second text box, and display the information on the screen.

    The ESP8266 has 96k of user ram, and the layout of this ram is described in the first 3 lines of the output.

    The text (IRAM – Instruction ram) section is a 32k block of memory that will contain cached parts of your program. A function is placed into the cache by prepending the ICACHE_FLASH_ATTR to a function. Cached functions run 12x faster than non cached functions (generally).

    The last section irom0_text is the data that is stored on the SPI flash chip, and is pulled off as and when needed. Program code in this section is 12x slower than code in the IRAM section.

    Apparently the irom0_text section is dynamically cached to speed things up, but it cannot be relied upon to always be running in the cache memory.

    • Hi Glen

      Thanks for a comprehensive reply.

      When I selected the xtensa objdump tool it all worked 🙂

      Hopefully this conversation will help other see the light.



  4. Well Glen’s tool has already made it possible for me to see some light – as it were. I’m messing with the MQTT code and the lack of an output buffer is severely hampering my efforts – thanks to using Greggs tool and compiling the code with a large RAM buffer I see I’m making a minimal dint in the RAM – that gives me the confidence to go ahead and develop a rotary output buffer for topics and messages. Tha’ts not to say it will work – it’s just to say I’m now daft enough to try.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s