[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] lwIP memory leak problem

From: yueyue papa
Subject: Re: [lwip-users] lwIP memory leak problem
Date: Fri, 5 Dec 2008 23:21:02 +0800

I just understand. It is not the memory leak problem.
sock->lastdata = buf = netconn_recv(sock->conn);  <<<=== means no data available.
but my socket is a block socket, why it do not block ?
Is there signal bug in my sys_arch.c?

On Fri, Dec 5, 2008 at 10:43 PM, yueyue papa <address@hidden> wrote:
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
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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]