Hi All,
I am using the lwIP + PPP now. The PPP begins to work, but we meet the memory leak probem. My lwIP is the later than 1.3.0 (check out form CVS.) I really have to see any memory leak problem reported since
1.3.0.
Our project out of memory in socket APIs
int
lwip_recvfrom(int s, void *mem, int len, unsigned int flags,
struct sockaddr *from, socklen_t *fromlen)
{
...
sock->lastdata = buf = netconn_recv(sock->conn); <<<=== out of memory
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: netconn_recv netbuf=%p\n", (void*)buf));
if (!buf) {
/* We should really do some error checking here. */
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): buf == NULL!\n", s));
sock_set_errno(sock, (((sock->conn->pcb.ip!=NULL) && (sock->conn->err==ERR_OK))?ETIMEDOUT:err_to_errno(sock->conn->err)));
return 0;
}
...
The netconn_recv is allocate from pool
In my lwipopts.h.
/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
sends a lot of data out of ROM (or other static memory), this
should be set high. */
#define MEMP_NUM_PBUF 16
What every how many size I increased, the out of memory is happened at same time ?
Is there any hint for me for where the memory is leak?
Lee