MEMP_TCP_SEG somehow being leaked so that they never become available for reuse.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

MEMP_TCP_SEG somehow being leaked so that they never become available for reuse.

geckook Xu
When I make a lot of connections to the server, the server's lwip
stack MEMP_TCP_SEG will be leaked.

at this time, the TCP_PCB is 0, and PBUF have the same number of EMP_TCP_SEG.

I think if it is because when release the TCP_PCB ,but didn't release
the TCP_SEG.

When the concurrent connections are amount.


_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: MEMP_TCP_SEG somehow being leaked so that they never become available for reuse.

Jonathan Larmour
geckook Xu wrote:
> When I make a lot of connections to the server, the server's lwip
> stack MEMP_TCP_SEG will be leaked.
>
> at this time, the TCP_PCB is 0, and PBUF have the same number of
> EMP_TCP_SEG.
>
> I think if it is because when release the TCP_PCB ,but didn't release
> the TCP_SEG.

The code certainly does release TCP SEGs in both the unsent and unacked
queues in tcp_abort() and tcp_pcb_remove().

How are you closing the connection? If you call tcp_close() and the
connection is in the ESTABLISHED state, it will not free up the SEGs
immediately. It needs to complete the closing process.

Jifl
--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine


_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: MEMP_TCP_SEG somehow being leaked so that they never become available for reuse.

geckook Xu
after calling tcp_about(), it looks like the TCP_SEG and TCP_PCB will
be released, but I only found TCP_PCB  released, and the amount of
TCP_PCB malloced become zerro and  TCP_SEG and PBUF will never be
released.

wether there are somewhere in the code , the connection between
TCP_PCB and TCP_SEG will be breaked so that when release TCP_PCB but
don't release TCP_SEG.

I use an client on pc to connect to lwip stack, I found if the lwip
stack didn't respond  immediately or didn't reply , the TCP_SEG will
be leaked soon.

On 4/20/07, Jonathan Larmour <[hidden email]> wrote:

> geckook Xu wrote:
> > When I make a lot of connections to the server, the server's lwip
> > stack MEMP_TCP_SEG will be leaked.
> >
> > at this time, the TCP_PCB is 0, and PBUF have the same number of
> > EMP_TCP_SEG.
> >
> > I think if it is because when release the TCP_PCB ,but didn't release
> > the TCP_SEG.
>
> The code certainly does release TCP SEGs in both the unsent and unacked
> queues in tcp_abort() and tcp_pcb_remove().
>
> How are you closing the connection? If you call tcp_close() and the
> connection is in the ESTABLISHED state, it will not free up the SEGs
> immediately. It needs to complete the closing process.
>
> Jifl
> --
> eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
> Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
> Registered in England and Wales: Reg No 4422071.
> ------["The best things in life aren't things."]------      Opinions==mine
>
>
> _______________________________________________
> lwip-devel mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/lwip-devel
>


_______________________________________________
lwip-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-devel