We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
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.