lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lwIP memory settings


From: Kieran Mansley
Subject: Re: [lwip-users] lwIP memory settings
Date: Wed, 21 Oct 2009 12:07:02 +0100

On Mon, 2009-10-19 at 12:31 +0200, Simon Goldschmidt wrote:
> > I need confirmation about the lwIP memory use.
> > 
> > The lwIP uses two areas of memory:
> > - one dedicated to the buffers pbuf and defined by :
> > PBUF_POOL_SIZE x PBUF_POOL_BUFSIZE
> > - and one area for the structures (tcp_pcb, udp_pcb) and other
> > variables which are dynamically allocated, and this area is defined
> > by: the MEM_SIZE
> 
> That's not all (and partly not correct):
> - There are 3 types of pbufs: REF/ROM, RAM and POOL. PBUF_POOL_SIZE * 
> PBUF_POOL_BUFSIZE only refers to type POOL.
> - RAM pbufs are allocated in the memory defined by MEM_SIZE (this memory is 
> not used much aside from RAM pbufs) - this is the *heap* and it is allocated 
> as mem_memory.
> - REF/ROM pbufs as well as pcbs and some other stuff is allocated from 
> dedicated pools per structure type. The amount of structures is defined by 
> the various MEMP_NUM_ defines. Together, this memory is allocated as 
> memp_memory and it *includes* the pbuf POOL.
> 
> However, if you define MEMP_MEM_MALLOC to 1 in your lwipopts.h, *every* piece 
> of dynamically allocated memory will come from the heap (the size of which is 
> defined by MEM_SIZE).

If there's not already a description like the above on the wiki, could
you add one?  That reply was an excellent summary.

Kieran





reply via email to

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