esp32 32E heap memory question

Gaston1980
Posts: 29
Joined: Sun Oct 06, 2024 10:26 am

esp32 32E heap memory question

Postby Gaston1980 » Tue Nov 26, 2024 6:58 pm

Hi to all, Im using the esp32 wroom 32E with vscode to test http connnection. Im sending data to a server suing client multipart header.
First of all I printf the heap memory available with:

Code: Select all

heap_caps_get_free_size(MALLOC_CAP_8BIT)
which give me:

Code: Select all

HEAP SIZE FREE 189956
If Im using an array of lenght 38KB and then I change the default value of the buffer in esp_http_client.h to 10KB, If I try to increase the client buffer to 15KB using malloc I got "not memory?

Code: Select all

    if((buffer=(char *)malloc(15000*sizeof(char)))==NULL)
        printf("NO MEMORY");
questions:
1) is 10KB max size buffer tx client http?
2)if I got 180KB+ of free memory..why can't use 15KB or more with malloc?
3) using MALLOC_CAP_8BIT the correct way to know how much free memory got?
Hope someone respond this question
Regards
Gastón

Who is online

Users browsing this forum: No registered users and 79 guests