Page 1 of 1

running out of memory allocation for tasks despite PSRAM of 8MB

Posted: Tue Mar 18, 2025 1:37 pm
by aygh4266
Hello everyone,

currently I am running out of memory allocation especially in the heap. I am using esp32s3 with 512KB internal RAM and 8MB external PSRAM.

Basically I created 4 tasks (UART, USB MSC Host, Bluetooth nimBLE and WiFi with Access point and https webserver)

I allocated all nimble, mbetls, and wifi memories on the PSRAM externally. It has been thousand times better but still crashes by mounting USB Device.

While I am using c++, I allocate all the instances dynamically using new placement directly on the PSRAM but still have issues with the RAM.

So I have a lot of memory on the PSRAM (about 7 MB). Is it possible to integrate the PSRAM with the internal RAM ? if not, what should I do, in order to run all tasks without any issues.

Re: running out of memory allocation for tasks despite PSRAM of 8MB

Posted: Thu Mar 20, 2025 9:53 pm
by egionet
The only suggestion that comes to mind is reviewing your menuconfig settings. There are various settings for PSRAM when it is enabled. The only other thing that comes to mind is a memory leak if RAM is getting consumed over time.

Re: running out of memory allocation for tasks despite PSRAM of 8MB

Posted: Thu Apr 10, 2025 1:24 pm
by aygh4266
The only suggestion that comes to mind is reviewing your menuconfig settings. There are various settings for PSRAM when it is enabled. The only other thing that comes to mind is a memory leak if RAM is getting consumed over time.
I have created tasks with xCreateTaskPinnedToCoreWithCaps, allocated the Objects on the PSRAM using heap_caps_malloc() and static and global variables and objects using the macro EXT_RAM_BSS_ATTR.

Here is my menuconfig for PSRAM Settings: