The memory of ESP32S3 is too large when using microython
I use the board of the ESP32. When I turn on microython, there will be more than 100 k of internal memory consumption. I have other functions to add. This more than 100 k of memory will cause me to run out of memory. What can I do to reduce the memory consumption of esp32 when using microython
When esp32S3 uses microython, it uses too much internal memory
I use ESP32S3, which uses 100k of internal memory when using microython. My board has PSRAM, gc_ Init() uses the memory requested by
PSRAM.Theoretically, except for 16k In addition to the mp_task () thread, other memory should be requested from PSRAM. Miraculously, I
didn't apply for memory elsewhere. When I started the microython thread, the system disappeared for no reason
100k of memory. It is not the heap memory consumed during use. I tried to add judgment in the mp_task() thread so that all Python related
code would not run, but the memory did not Reduce. Unless the thread is annotated or the code inside the thread is annotated, the
memory will be reduced by 100k. By comparing the memory size of whether to start microython when compiling, I find that it seems to be
allocated when compiling.But I still don't know where to use the memory. Does anyone know where these memories are consumed and
how to reduce them. Any answer would be highly appreciated.
This is the memory distribution at compile time without the mp_task () annotation
Used static IRAM: 139730 bytes ( 222510 remain, 38.6% used)
.text size: 138703 bytes
.vectors size: 1027 bytes
Used stat D/IRAM: 67137 bytes ( 105791 remain, 38.8% used)
.data size: 30641 bytes
.bss size: 36496 bytes
Used Flash size : 1793666 bytes
.text : 1363395 bytes
.rodata : 430015 bytes
Total image size: 1964037 bytes (.bin may be padded larger)
This is the memory distribution at compile time after the mp_task () annotation:
Used static IRAM: 71138 bytes ( 291102 remain, 19.6% used)
.text size: 70111 bytes
.vectors size: 1027 bytes
Used stat D/IRAM: 35457 bytes ( 137471 remain, 20.5% used)
.data size: 17121 bytes
.bss size: 18336 bytes
Used Flash size : 480211 bytes
.text : 354359 bytes
.rodata : 125596 bytes
Total image size: 568470 bytes (.bin may be padded larger)