lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lwIPv1.3.0 memory


From: Benoit Camus
Subject: Re: [lwip-users] lwIPv1.3.0 memory
Date: Wed, 03 Mar 2010 09:55:28 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Hello Bill,

Here is the way i do to fine tune LwIP's memory to my application, maybe will it help you with you first question:

First i use the lwip statistics ( have to define SYS_STATS in lwipopts.h).
Then i stop application with debugger before and after having applied some loads over the system and look at the lwip_stats structure (global variable in stats.c) to get the memory requirements. Of course loads you apply must be typical ones to cover all your system behaviour. I do it too with a long time test.

The lwip_stats structure gives you the currently used memory ( number of buffers from pools or bytes in heap), and the max used and number of errors too for each one. Semaphore and queue values are also interesting to look for. This allows you to set lwipopts.h with the closest values needed by you application. Of course keep some margin due to
ethernet network nature.

Heap is easely identify (first one in memp tab if i remeber well).
Looking for pools is a little harder (some can be desactivated) and i suggest you to use preprocessor over memp.c to see the order of pools and make the mind link easier.

I would also be interesting if anyone using another way to tune lwipopts.h could tell about it.

B. Camus

Hi,

I have three questions regarding the memory definitions in lwipopts.h based on lwIPv1.3.0. I wonder if some one can help me.

(1) In current memory options defined as below.

//#define MEM_LIBC_MALLOC 0

#define MEM_ALIGNMENT 4 // default is 1

#define MEM_SIZE (18 * 1024) // default is 1600, was 16KIntDefaultHandler

//#define MEMP_OVERFLOW_CHECK 0

#define MEMP_SANITY_CHECK 1

//#define MEM_USE_POOLS 0

//#define MEMP_USE_CUSTOM_POOLS 0

Q1: Can I reduce the MEM_SIZE TO (12 * 1024)? Is there any risk there?


* *

* *

*Bill Yang**
**Software Engineer**
**
**direct: +1 801.433.6354**
**email: address@hidden <mailto:address@hidden@parvus.com>*

*
***Parvus**

**RUGGED SOLUTIONS for REAL WORLD APPLICATIONS**

*USA** – 3222 S. Washington St. | Salt Lake City, Utah 84115 | Tel. +1 801.483.1533 | Fax +1 801.483.1523 |**
***www.parvus.com**** **

*A Member of EUROTECH GROUP*

------------------------------------------------------------------------

_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


--

Benoît CAMUS
Leroy Automatique Industrielle
Bd du Libre échange - 31650 Saint-Orens
Standard : 05.62.24.05.50
e-mail : address@hidden





reply via email to

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