Page 1 of 1

Official build use less RAM memory then own build

Posted: Sat Oct 09, 2021 8:43 pm
by lipapave@seznam.cz
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 ?

Re: Official build use less RAM memory then own build

Posted: Sun Oct 10, 2021 7:04 am
by Roberthh
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.

Re: Official build use less RAM memory then own build

Posted: Sun Oct 10, 2021 11:28 am
by bulletmark
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.

Re: Official build use less RAM memory then own build

Posted: Sun Oct 10, 2021 7:02 pm
by lipapave@seznam.cz
Thank you so much!