esp_tls possible memory leak

octavio.santana
Posts: 5
Joined: Wed Mar 08, 2023 5:08 am

esp_tls possible memory leak

Postby octavio.santana » Sat Jul 08, 2023 6:06 am

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.

octavio.santana
Posts: 5
Joined: Wed Mar 08, 2023 5:08 am

Re: esp_tls possible memory leak

Postby octavio.santana » Mon Jul 10, 2023 2:02 pm

Hi,
False alarm, no memory leakage, I was overwriting pxTls setting it to NULL, thus loosing its allocated memory!

Sorry
O.

Who is online

Users browsing this forum: Bing [Bot] and 91 guests