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

aygh4266
Posts: 36
Joined: Mon Mar 04, 2024 10:33 am

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

Postby aygh4266 » Tue Mar 18, 2025 1:37 pm

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.

User avatar
egionet
Posts: 39
Joined: Thu Sep 26, 2024 4:34 am
Location: Atlantic Canada

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

Postby egionet » Thu Mar 20, 2025 9:53 pm

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.
Regards,

Eric Gionet P.Tech.(Eng.), CIOTP, SMIEEE

aygh4266
Posts: 36
Joined: Mon Mar 04, 2024 10:33 am

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

Postby aygh4266 » Thu Apr 10, 2025 1:24 pm

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:
Attachments
PSRAM.PNG
PSRAM.PNG (47.44 KiB) Viewed 972 times

Who is online

Users browsing this forum: No registered users and 3 guests