Page 1 of 1

esp_tls possible memory leak

Posted: Sat Jul 08, 2023 6:06 am
by octavio.santana
Hi,
sorry for double posting, but I cannot find my old post in this forum
I am using coreMQTT, in my application, connection is continuously running , every now and then, there is a need of a reconnection, and here is where the problem pop up.

When calling function
TlsTransportStatus_t xTlsConnect( NetworkContext_t* pxNetworkContext )
And when function esp_tls_conn_new_sync is called, there is a sudden memory consumption of 28kB

In reconnection attempt, xTlsConnect will be called again, thus allocating another ~30kB and so on.

I thought, I might need to issue a disconnection via

TlsTransportStatus_t xTlsDisconnect( NetworkContext_t* pxNetworkContext )

Which internally calls
esp_tls_conn_destroy

I do not seem to recover previously allocated 28kB back.

Do you have any idea???
O.

Re: esp_tls possible memory leak

Posted: Mon Jul 10, 2023 2:02 pm
by octavio.santana
Hi,
False alarm, no memory leakage, I was overwriting pxTls setting it to NULL, thus loosing its allocated memory!

Sorry
O.