This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Free memory on heap

Hi,

Is there a way to find out how much memory is left on the heap in runtime or with other words, how much memory is free to use malloc ?

Luc Vercruysse

Parents
  • Just remember that most embedded devics are far better off by avoiding dynamic memory - or at least avoiding the use of a traditional heap.

    It's so hard to deduce how it behave after having been running for 6 months without a reboot - memory fragmentation can make the usable blocks smaller and smaller.

    Most times, it's better to have a fixed number of fixed-size blocks in a pool. For example for buffering TCP/IP packets. Maybe have one pool of N large memory blocks, and another pool of M small memory blocks.

Reply
  • Just remember that most embedded devics are far better off by avoiding dynamic memory - or at least avoiding the use of a traditional heap.

    It's so hard to deduce how it behave after having been running for 6 months without a reboot - memory fragmentation can make the usable blocks smaller and smaller.

    Most times, it's better to have a fixed number of fixed-size blocks in a pool. For example for buffering TCP/IP packets. Maybe have one pool of N large memory blocks, and another pool of M small memory blocks.

Children
No data