Official build use less RAM memory then own build

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
lipapave@seznam.cz
Posts: 4
Joined: Sat Oct 09, 2021 7:06 pm

Official build use less RAM memory then own build

Post by lipapave@seznam.cz » Sat Oct 09, 2021 8:43 pm

Hello,

I would like to ask you, if somebody know, why is own esp32 build 1.17 of micropython (https://github.com/micropython/micropython) using more RAM then build of esp32-20210902-v1.17.bin from official web page https://micropython.org/download/esp32/ ?

I print

Code: Select all

import gc
gc.collect()
print("Mem free: ",gc.mem_free())
on start of boot.py file and when I use official build I get about 110 kB of free RAM memory, but when I use own build image with same version I get 55 kb of free RAM memory.

Console Output:

Official build
MPY: soft reboot
Mem free: 110096
MicroPython v1.17 on 2021-09-02; ESP32 module with ESP32
Type "help()" for more information.
Own generated build
MPY: soft reboot
Mem free: 62928
MicroPython v1.17 on 2021-09-02; ESP32 module with ESP32
Type "help()" for more information.


Can be caused by optimalisation of building code or why is this happen ?

User avatar
Roberthh
Posts: 3668
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Official build use less RAM memory then own build

Post by Roberthh » Sun Oct 10, 2021 7:04 am

That was discussed in another thread as well. It is related to the ESP-IDF version you are using. With ESP-IDF V4.2 you get 110k, with V4.3 and v4.4 one ends up at ~65k. So if you are building for the "classic" EP32, use v4.2.

bulletmark
Posts: 59
Joined: Mon Mar 29, 2021 1:36 am
Location: Brisbane Australia

Re: Official build use less RAM memory then own build

Post by bulletmark » Sun Oct 10, 2021 11:28 am

I brought up this issue in this thread. My conclusion there is that currently the best esp-idf version to use for generic esp32 is version 4.2.2.

lipapave@seznam.cz
Posts: 4
Joined: Sat Oct 09, 2021 7:06 pm

Re: Official build use less RAM memory then own build

Post by lipapave@seznam.cz » Sun Oct 10, 2021 7:02 pm

Thank you so much!

Post Reply