Hi, Dear.
Other targets(eg, Windows-PC) repeatedly run
"connect"->"read/write"->"close"->"connect"... for the lwIP-targets.
The lwIP will not release memory. (MEMP_TCP_SEG)
tcp_pcb_purge () does not free in the case of state/seg/stack-trace to the
printf() to show up in the console.
As a result, during the following processes, the lwip does not release memory.
+-- lwIP-Target Status ---+
pcb->state==LAST_ACK
pcb->ooseq!=NULL
or
pcb->unack!=NULL
+-------------------------+
|
V
Received ACK from Windows-PC.
|
V
tcp_input()
tcp_process()
pcb->state=CLOSED
tcp_pcb_remove(&tcp_active_pcbs, pcb);
tcp_pcb_purge(pcb);
But state==CLOSED then not free pcb->ooseq!=NULL or pcb->unack!=NULL
tcp_pcb_purge() statement in the following decision I think should be removed.
if (pcb->state != CLOSED &&
pcb->state != TIME_WAIT &&
pcb->state != LISTEN) {
"pcb->unsent/unacked/ooseq" is initialized to NULL at tcp_alloc().
tcp_pcb_purge() is called at the time, "pcb->unsent/unacked/ooseq !=NULL" means
that the memory holds.
There is no problem in my environment.
The above is correct?
Izumi
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users