[Top][All Lists]

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

Re: [lwip-users] lwIP memory settings

From: Simon Goldschmidt
Subject: Re: [lwip-users] lwIP memory settings
Date: Mon, 19 Oct 2009 12:31:51 +0200

> I need confirmation about the lwIP memory use.
> The lwIP uses two areas of memory:
> - one dedicated to the buffers pbuf and defined by :
> - 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 
- 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).

GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

reply via email to

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