lwip-devel
[Top][All Lists]
Advanced

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

Re: RE : [lwip-devel] Memory leak for timeouts


From: Marc CHALAND
Subject: Re: RE : [lwip-devel] Memory leak for timeouts
Date: Tue, 6 Nov 2007 12:04:38 +0100

2007/11/6, Frédéric BERNON <address@hidden>:
>
> If your OS provide you an TLS feature, it should provide a way to call a 
> cleanup
> function when a thread is terminated,

There is no cleanup system provided by L4. Each thread has to free the
memory it has allocated with a malloc. In our case, we have to free
memory allocated for sys_timeouts structure and which are referenced
into TLS. Then a thread_exit call is done to terminate the thread. All
this stuff has been put into a function which we called
sys_thread_exit.

> I don't think that lwIP could provide a such support, since a thread can use 
> several
> sockets/netconn,

I agree with you. Thread creation and deletion should not be done by
lwip as it is specific to one port. And such operation can be done out
of lwip.

> number of threads is limited and static, and not dynamic. So, the "memory 
> leak" is
> more a "memory use". Perhaps I'm wrong.

OK, that explains why this problem doesn't produce on other platforms.

> Note that in CVS head, the problem should only appears with "select" calls 
> (and
> PPP).

Thank you for this information. As we create a thread per select call,
that explains our memory starvation.

Marc




reply via email to

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