[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] How to release all memory to track leaks
From: |
Tomasz W |
Subject: |
Re: [lwip-users] How to release all memory to track leaks |
Date: |
Fri, 4 Jun 2021 13:42:17 +0200 |
Hi
Lok for this
https://lists.nongnu.org/archive/html/lwip-devel/2020-12/msg00014.html
In my case it solved the problem of the web server dying after a few days.
pt., 4 cze 2021 o 12:14 R. Diez via lwip-users <lwip-users@nongnu.org>
napisaĆ(a):
>
> 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
>
> _______________________________________________
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
--
Pozdrawiam
Tomek