HTTPS takes more than 40kb of memory

mmmunir966
Posts: 12
Joined: Tue Feb 08, 2022 2:02 pm

HTTPS takes more than 40kb of memory

Postby mmmunir966 » Thu Mar 30, 2023 9:51 am

Hi,
I am running tow tasks. One to send data to cloud platform using https request and 2nd to perform the OTA update. I run some memory analysis and got the results shown in the attached picture. The issues I am facing are:
1. The https requests are taking more than 40kb of memory when either uploading data or checking OTA update.
2. My device halts for 2-3 hours every 12 hours. It means device does not generate any logs and do not perform ota update and it restarts after two hours. When I look at last log, the heap memory shown is around 54Kb everytime when device halts.
3. My device crashes if both the tasks are trying to perform https simultaneously as I am running each task on each core of esp32.

I need help to reduce the memory utilization during https request.
I am integrating single SSL certificate using in
esp-idf v4.4

Code: Select all

esp_http_client_config_t clientConfig = {
            .url = binaryFileHost.c_str(),
            .user_agent = userAgentHTTP.c_str(),
            .timeout_ms = 30000,
            .transport_type = HTTP_TRANSPORT_OVER_SSL,
            .crt_bundle_attach = esp_crt_bundle_attach,
            .keep_alive_enable = true,
        };

and

Code: Select all

esp_http_client_config_t config = {
            .url = hostUrl.c_str(),
            .user_agent = userAgentHTTP.c_str(),
            .method = HTTP_METHOD_POST,
            .timeout_ms = 30000,
            .event_handler = _httpEventHandler,
            .transport_type = HTTP_TRANSPORT_OVER_SSL,
            .crt_bundle_attach = esp_crt_bundle_attach,
            .keep_alive_enable = true,
        };
Any help would be much appreciated.
Attachments
Heap Memory Usage.png
Heap Memory Usage.png (142.18 KiB) Viewed 1175 times

Who is online

Users browsing this forum: No registered users and 332 guests