lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] How to release all memory to track leaks


From: R. Diez
Subject: [lwip-users] How to release all memory to track leaks
Date: Fri, 4 Jun 2021 10:09:34 +0000 (UTC)

Hi all:

I have a bare-metal (Newlib, no threads) firmware that uses lwIP and its httpd 
server to provide a simple web interface.

The firmware is actually quite complex in other areas. I am trying to identify 
and track down memory leaks, so I implemented a "shutdown" command in the debug 
console that releases all resources and checks the remaining allocated bytes 
with mallinfo().

I suspect some of the remaining memory "leaks" belong to lwIP and/or its httpd 
server, because they only come up after having downloaded the web page once. 
They are probably not real leaks, because memory usage does not grow over time.

It is hard to say, because I have not figured out yet how to track memory 
allocations in an embedded Newlib firmware like this.

In any case, I would like lwIP to release all memory on shutdown, in order to 
locate any memory leaks in other parts. The trouble is, there are routines like 
lwip_init() and httpd_init(), but no xxx_terminate() counterparts.

I tried removing all interfaces with netif_remove(), but that is probably not 
enough.

Is there some trick I could use? For example, something like ticking all state 
machines again after all interfaces have been removed could possibly trigger a 
complete memory release all over the place.

Thanks in advance,
  rdiez


reply via email to

[Prev in Thread] Current Thread [Next in Thread]