|
From: | Larry Rachman |
Subject: | [lwip-users] pbuf / memory leak on ADI blackfin implementation |
Date: | Wed, 12 Jul 2006 11:45:11 -0400 |
We
are in the process of implementing LWIP on Blackfin-based proprietary hardware,
starting with the package that Analog Devices offers as part of their
development environment. Our primary change to their base release was a shift
to a different MAC/PHY combination, which appears to be working well. We
are running a simple test consisting of opening a TCP/IP connection from a PC
to LWIP, sending a short (16 char) message which is echoed using the raw api,
waiting for a reply at the PC end, and repeating the exchange. After about 330
(+/-) transactions, the system stalls. (BTW, we *are* calling tcp_recved()
after receiving each packet.) After
probing at the stuck code, we see that the incoming packet is received and
passed through the receive queue, but is then discarded when process_received_packets()
calls pbuf_alloc(), which calls mem_malloc() which returns NULL (no
memory available). Apparently
there is some sort of memory leak. As an experiment, we increased MEM_SIZE by a
factor of 2 and the system then stalled after approximately 2x the original
message count. After
some exploration of the mailing list archives, we tried changing PBUF_LINK_HLEN
from 14 to 16. No change was seem One
recurring theme in the archives was to replace mem_malloc() with malloc(),
assuming that it’s available in your environment (it is in ours). But if
I do that, I’m worried about disguising the problem rather than solving
it; as our system has lots of RAM – I’d just be pushing the failure
point out further in time. Can
anyone offer any suggestions as to how we might chase this, i.e. places to
look, things to try, etc. Thanks
in advance, Larry
Rachman NAII |
[Prev in Thread] | Current Thread | [Next in Thread] |