Need Help regarding Netconn Memory Leak Issue

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need Help regarding Netconn Memory Leak Issue

Postby Ritesh » Wed Dec 06, 2017 5:28 pm

ESP_Angus wrote:Hi Pratik,

Thanks for posting the code and the log. It's not clear to me from the log that you have a memory leak. If I look at the same log line in your code each time around the loop, there's no long-term trend of less free RAM:

Code: Select all

I (23662) main: system_get_free_heap_size after accept  =230864
 
I (24452) main: system_get_free_heap_size after accept  =230648
 
I (25592) main: system_get_free_heap_size after accept  =230440
 
I (879372) main: system_get_free_heap_size after accept  =229896
 
I (892582) main: system_get_free_heap_size after accept  =229352
 
I (925662) main: system_get_free_heap_size after accept  =230524
 
I (925802) main: system_get_free_heap_size after accept  =230872
In fact, the final log line shows more free heap (230872) than the initial line (230864).

This kind of minor variation over time is due to the TCP/IP & WiFi library activity. Some of it may be explained by TCP sockets in the TIME_WAIT state, as I mentioned above, but the WiFi library may also allocate temporary buffers for various uses.

If you see a long term trend of free memory reducing, that is a memory leak.
Hi,

Ok. Yes.we can say it as short term memory leak which is going to free after sometime.

I think Espressif Systems has fixed that memory leak issue from LWIP netconn code and also released it under master tree.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: nathan_swidget and 122 guests