How to calculate heap size?
Posted on 2009-02-17
We write Embedded 'C' for Freescale PowerPC based Controllers. 29Kbytes was reserved for heap in the MPC563 Microcontroller internal RAM. I stole 2Kbytes. Now 27Kbytes is left for the heap.
Our code is complex and large in size. I dont' know how much heap it needs. How can I find the actual size of heap needed by the program?
I don't think 29Kbytes of space is needed for the heap? I think 29Kbytes was assigned for heap because that was the remaining amount of space left in internal RAM. I need to know the actual amount of heap needed by the program.
For example, if program needs 20Kbytes, then taking 2Kbytes out of 29Kbytes space reserved for heap would not be a problem at all.