Skip to main content
samiassaad
Associate III
March 28, 2011
Question

Heap size

  • March 28, 2011
  • 4 replies
  • 969 views
Posted on March 28, 2011 at 09:08

Heap size

    This topic has been closed for replies.

    4 replies

    Andrew Neil
    Super User
    May 17, 2011
    Posted on May 17, 2011 at 14:29

    This is a standard 'C' term;  it has nothing specifically to do with the STM32 - or even with embedded development!

    The Heap is the term used for the memory ''pool'' available for dynamic memory allocation by the standard 'C' library functions such as malloc

    ''how does heap size effect my project? how to set it ? usage of it ?''

     

     

    That depends on the particular tools you are using

    ''Could you give a quik veiw please ?''

     

     

    You will need to study the manuals for the particular tools that you are using.

    Note that dynamic memory allocation is often best avoided on embedded systems...
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Andrew Neil
    Super User
    May 17, 2011
    Posted on May 17, 2011 at 14:29

    http://www.keil.com/forum/18655/

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    samiassaad
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 14:29

    Thank you Neil

    I am using uv4 (keil ) ; I could dont find info about heap in the manual , could you give a link or a short info please ?

    what is the effect of small heap and large heap on a project ?

    Tesla DeLorean
    Guru
    May 17, 2011
    Posted on May 17, 2011 at 14:29

    what is the effect of small heap and large heap on a project ?

    The size of the heap constrains the total capacity of malloc()'s you can have outstanding. If you fragment the heap, your total/linear capacity will be diminished, as it will if you leak resources (fail to free).

    With GNU/GCC the heap basically takes all the unallocated RAM between your statics, and your stack.

    http://www.lmgtfy.com/?q=embedded+software+heaps

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..