lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] mem_malloc(): memory fragmentation


From: Goldschmidt Simon
Subject: [lwip-users] mem_malloc(): memory fragmentation
Date: Mon, 23 Oct 2006 12:53:40 +0200

Hi,
 
I'm currently working on an embedded product which should use the lwIP-stack. Since the application should be running for _very_ long time, the memory allocation used by mem_malloc() is not really appropriate since it seems to be using a normal malloc()-like heap.
 
My question is: has anyone ever bothered to somehow avoid using a heap and using pools instead?
 
I would favor solving this problem by 'fixing' savannah bug #3031 submitted by Leon Woestenberg, which basically proposes getting rid of PBUF_RAM and using pools instead. As other modules use mem_malloc() also (dhcp/snmp/loopif), maybe a better solution might be to implement mem_malloc() as different pools and leave the PBUF_RAM implementation since it would be allocated from pools then.
 
The downside to this is that more RAM is needed, since only three or four pools with different block sizes would be created, but this way, you can calculate the memory needs based on application throughput and e.g. TCP_WND, what you can't if your memory gets fragmented...
 
Any comments?
 
Simon

reply via email to

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