Memory problem with MQTT and new()
Posted: Wed Oct 02, 2024 2:27 pm
Hi,
I have a project which is mainly written in C++ and uses a lot of. Somehow this causes the MQTT-client to not be able to allocate memory. I have tried to fix this problem by using different sdkconfig options, but I wasn't able to solve the problem. The free HEAP before the mqtt-client tries to allocate its memory is around 4MB, so should be more than enough.
In sdkconfig I have:
Now I wonder, if always goes into internal memory and mqtt needs some space there and can not be completely allocated in external memory?
Do I need to tell to allocate specifically in external memory?
Setup:
- esp32s3-N16R8
- esp-idf 5.3.1
Hope someone can help...
Best
I have a project which is mainly written in C++ and uses a lot of
Code: Select all
new()
In sdkconfig I have:
Code: Select all
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_MEMTEST=y
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=2048
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED=y
CONFIG_MQTT_USE_CORE_0=y
Code: Select all
new()
Do I need to tell
Code: Select all
new()
Setup:
- esp32s3-N16R8
- esp-idf 5.3.1
Hope someone can help...
Best