tasklwIP - A Lightweight TCP/IP stack - Tasks: task #7890, Review heap usage

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #7890: Review heap usage

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Wed 26 Mar 2008 08:24:48 AM UTC
   
 
Category:  None Should Start On:  Wed 26 Mar 2008 12:00:00 AM UTC
Should be Finished on:  Wed 26 Mar 2008 12:00:00 AM UTC Priority:  3 - Low
Status:  Done Privacy:  Public
Assigned to:  goldsimon Percent Complete:  100%
Open/Closed:  Closed Planned Release:  None
Effort:  0.00

Jump to the original submission

Sun 16 May 2010 02:37:09 PM UTC, comment #7: 

... and finally done: DNS_LOCAL_HOSTLIST_IS_DYNAMIC and PPPoE have their own pools, too. Now we only have to find a clean way to solve bug #3031 and we are completely heap-free if we want to.

Simon Goldschmidt <goldsimon>
Group administrator
Fri 12 Feb 2010 04:44:01 PM UTC, comment #6: 

dhcp and autoip can now be initialized to use a user-defined struct dhcp/autoip (e.g. allocated statically for each netif)

Simon Goldschmidt <goldsimon>
Group administrator
Tue 02 Feb 2010 03:17:52 PM UTC, comment #5: 

Update: netdb has an own memp pool

Remaining:
- ppp_oe.c uses mem_malloc
- DNS_LOCAL_HOSTLIST_IS_DYNAMIC uses mem_malloc, could be converted to a static array or memp pool
- dhcp and autoip, and dns use mem_malloc but only once during initialization so that's ok
- example apps use mem_malloc, but that's ok

Simon Goldschmidt <goldsimon>
Group administrator
Mon 01 Feb 2010 08:20:25 PM UTC, comment #4: 

Update: dhcp now only mallocs on the first call to dhcp_start

Simon Goldschmidt <goldsimon>
Group administrator
Tue 26 Jan 2010 08:29:55 PM UTC, comment #3: 

Update: added pools for snmp

Simon Goldschmidt <goldsimon>
Group administrator
Mon 26 Oct 2009 10:05:17 AM UTC, comment #2: 

Update:
- autoip: doesn't count since it only allocates but doesn't free (memory is always reused)
- netdb: only allocates one block of memory, could be easily converted to a memp pool (max name length would need to be configured for that)

Remaining:
- dhcp (struct dhcp could be re-used as in autoip)
- snmp
- netdb -> memp pool

Simon Goldschmidt <goldsimon>
Group administrator
Tue 21 Apr 2009 07:54:37 PM UTC, comment #1: 

Remaining users of heap (that cannot be configured to use statically allocated memory) are:
- netdb (16, 36 or 'namelen' of bytes -> 16 up to ~1460 bytes?)
- snmp (16, 32, 28, value_len, array-of-u32_t, len(u8_t) -> anything between 1 and 255 bytes)
- autoip (10 bytes)
- dhcp (? 1 up to ~1460 bytes?)

So, all in all, we have only few occurrences left. I can live with netdb, but the downside is that for dhcp and snmp, the maximum size is unknown.

For dhcp (since boot_file_name is currently unused (why?)), it would be enough to have a netif_dhcp which reserves space for a struct dhcp, the maximum size of options_in and dhcp_msg.

However, for snmp, I'm not sure :-(

Note that I am not interested in 'allocate-once-on-startup' allocations but only in 'runtime-alloc-and-free' allocations to be able to minimize the heap size without risking fragmentation.

To regard this as fixed, we can either
- live with all the heap going into statically allocated pools or
- solve dhcp and dig into snmp a bit or
- a bit of both

Is there anyone interested in this except for me? ;-)

Simon Goldschmidt <goldsimon>
Group administrator
Wed 26 Mar 2008 08:24:48 AM UTC, original submission:  

The idea for this came up in bug #3031: Implement a new fully pool-based pbuf implementation.

Since PBUF_RAM can already/easily be changed to use pools, we should check the rest of the stack using mem_malloc directly: Maybe some parts can use static allocation (dhcp) or dedicated pools...

Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-05-16 goldsimon StatusNone Done
        Percent Complete90% 100%
        Open/ClosedOpen Closed
    2010-02-02 goldsimon Percent Complete60% 90%
    2010-01-26 goldsimon Percent Complete10% 60%
    2009-10-26 goldsimon Percent Complete0% 10%
        Assigned toNone goldsimon
    2009-04-21 goldsimon Priority5 - Normal 3 - Low

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code