Not enough size of heap

taoglas
Posts: 5
Joined: Thu Jan 26, 2023 9:46 am

Not enough size of heap

Postby taoglas » Mon Nov 20, 2023 7:49 am

Good day. I have a problem with the module ESP32­-WROOM­-32E-N8. I need to create 10 parallel SSL connections to different servers. I'm using the mbedtls library. After starting the program, I have 187 kilobytes free (heap size: 187292 bytes). I only have enough memory for 5 connections. After five connections, only about 300 bytes remain (heap size: 364 bytes). Are there any tricks to get 10 connections with this module? Is this even realistic?
Next question. There are the same modules with additional memory of 2 megabytes PSRAM (ESP32-WROOM-32E-N8R2). Can PSRAM be used as a heap? Is this memory suitable for creating tasks for additional SSL connections?
Used static DRAM: 60340 bytes ( 120396 remain, 33.4% used)
.data size: 29900 bytes
.bss size: 30440 bytes

Used static IRAM: 89034 bytes ( 42038 remain, 67.9% used)
.text size: 88007 bytes
.vectors size: 1027 bytes

Used Flash size : 840311 bytes
.text : 634443 bytes
.rodata : 205612 bytes

Total image size: 959245 bytes (.bin may be padded larger)
Thanks for the help.

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: Not enough size of heap

Postby mbratch » Mon Nov 20, 2023 3:18 pm

That's a lot of heap space. How much dynamic data are you allocating per connection? Is it necessary to allocate so much all the time?

Who is online

Users browsing this forum: No registered users and 81 guests