[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Memory Limitation of lwIP?
From: |
nrichard |
Subject: |
Re: [lwip-users] Memory Limitation of lwIP? |
Date: |
Fri, 4 Aug 2017 13:50:38 -0700 (MST) |
address@hidden wrote
> nrichard wrote:
>> I have been able to get these all running
>> at the same time using the HEAP? method by setting both MEM_LIBC_MALLOC
>> and
>> MEMP_MEM_MALLOC to 1. However it is not consistent. Sometimes the
>> system
>> tells me "memp_malloc: out of memory in pool PBUF_POOL" even though I'm
>> using the HEAP method (I thought).
>
> This is expected. Although using the heap instead of multiple pools,
> statistics and error messages
> are still kept per pool, as this makes it easier to start with heap and
> use the statistics to size the pools later.
>
>> Is it bad to have all these applications running off of the HEAP method?
>
> You should be aware of the possibility of heap fragmentation and the fact
> that memory allocation
> can at some point get really slow depending on the free block count and
> sizes on your heap.
>
> Other than that, it should work. For the reasons above, pools are
> preferred though.
I'm going to try using pools, just to see if it works better for my system.
I have gathered the following memory results for pools:
MEM HEAP
avail: 43008
used: 0
max: 5144
err: 0
MEM UDP_PCB
avail: 2
used: 1
max: 1
err: 0
MEM TCP_PCB
avail: 4
used: 0
max: 4
err: 0
MEM TCP_PCB_LISTEN
avail: 8
used: 2
max: 2
err: 0
MEM TCP_SEG
avail: 16
used: 0
max: 4
err: 0
MEM REASSDATA
avail: 2
used: 0
max: 0
err: 0
MEM FRAG_PBUF
avail: 6
used: 0
max: 0
err: 0
MEM SYS_TIMEOUT
avail: 3
used: 2
max: 3
err: 0
MEM PBUF_REF/ROM
avail: 4
used: 0
max: 2
err: 0
MEM PBUF_POOL
avail: 32
used: 16
max: 17
err: 0
If I'm using pools now, does it make sense for MEM HEAP to be using 5144 of
43008? This is definitely a decrease from before (35k down to 5k).
I also see "memp_malloc: out of memory in pool TCP_PCB" being printed each
time I visit a web page. I have my pbuf pool set to 32, yet it only uses
16. Is this also normal behavior?
This also broke functionality for SNMP, but I will look into that
afterwards.
Plus side: hasn't crashed yet.
--
View this message in context:
http://lwip.100.n7.nabble.com/Memory-Limitation-of-lwIP-tp30350p30375.html
Sent from the lwip-users mailing list archive at Nabble.com.