• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP8266 used/free flash memory, used/free RAM in micropython

Q&A Forum › Category: ESP8266 › ESP8266 used/free flash memory, used/free RAM in micropython
0 Vote Up Vote Down
Enzo Pontone asked 4 years ago

Hello,
I can’t find the correct use of esp.free and esp.freemem to know the current amount of used/free flash/RAM.
I tried gc.mem_free() but I’m not sure if the result if all the available RAM or just the heap or somerhing other.
Please, any hint?

Question Tags: flash size, MicroPython, RAM size
7 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Enzo.
According to documentation: it returns the number of bytes of available heap RAM, or -1 if this amount is not known.
Learn more here: https://docs.micropython.org/en/latest/library/gc.html#gc.mem_free
Regards,
Sara

0 Vote Up Vote Down
Enzo Pontone answered 4 years ago

But if I need to know the amounts of total available (not used yet) RAM/flash?

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi.
Honestly, I don’t known.
Have you tried:

import micropython
micropython.mem_info()

Regards,
Sara

0 Vote Up Vote Down
Enzo Pontone answered 4 years ago

Thanks Sara,
I didn’t know of micropython module.
It gives back useful information about RAM but not about flash.
It’s a first step 🙂
Thanks.

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Try to take a look at the documentation and see if you find something that can be more useful for your scenario: http://docs.micropython.org/en/latest/
I hope this helps.
Regards,
Sara

0 Vote Up Vote Down
Enzo Pontone answered 4 years ago

Not found anything more about free memory than micropython module which you told me.
Thanks for that, however, it’s better than nothing!
Enzo

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Ok.
Let me know if you find something better.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.