[lwip-users] memp_malloc: out of memory in pool TCP_PCB

668 views
Skip to first unread message

Anirudha Sarangi

unread,
Nov 4, 2011, 4:32:00 AM11/4/11
to Mailing list for lwIP users
Hi,
Recently after fixing my previous issue (I had an issue in sys_arch.c), I came across one interesting issue for lwip140 which is not seen in lwip130.
 
I have a RTOS based application running and I have a small webserver application.
I saw that after refreshing the webpage several times on the host PC, I start getting messages:
 
memp_malloc: out of memory in pool TCP_PCB
 
Inspite of these messages webserver works. But these messages are really annoying and tell us that something horrible has happened.
 
I checked the memory pools. I have defined "MEMP_NUM_TCP_PCB as 64".
So precisely after around 64 http requests, I start getting the above message.
If I reduce MEMP_NUM_TCP_PCB to 32, I start getting the messages after around 32 refreshes.
 
Is it some kind of bug? Is there anything I should be doing while closing the socket each time other than calling lwip_close ?
 
 
regards
Anirudha

Simon Goldschmidt

unread,
Nov 4, 2011, 6:45:23 AM11/4/11
to Anirudha Sarangi, Mailing list for lwIP users
Anirudha Sarangi <anirudha...@yahoo.com> wrote:

memp_malloc: out of memory in pool TCP_PCB
 
Inspite of these messages webserver works. But these messages are really annoying and tell us that something horrible has happened.

No, that's normal: you ran out of pcbs, but the tcp code then closes that oldest pcb in TIME-WAIT state and then calls memp_malloc again, which then succeeds. This is why the web server continues to run normally.

In tcp, pcbs stay in TME_WAIT state for some minutes, so you would have to configure the tcp pcb pool very large to get rid of this message.

Simon

Anirudha Sarangi

unread,
Nov 4, 2011, 7:19:09 AM11/4/11
to Mailing list for lwIP users
Thanks a lot for the clarification.

_______________________________________________
lwip-users mailing list
lwip-...@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply all
Reply to author
Forward
0 new messages