This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48L952ZWT: How to do Heap Profiling



How do I do heap profiling?

I already know how to do stack profiling. I have an assembly language routine that returns the current stack pointer, which I then use in my C code. Heap stuff is more complicated and that does not use the stack pointer, so how do I check that?

  • Sarah,

    I'm going to move this one to the compiler forum as the heap is a compiler construct.
  • The TI ARM compiler supports no solution for keeping track of how much of heap memory gets used.  

    That said, there is one undocumented item you are welcome to explore.  The heap functions are implemented in the RTS library, in a source file named memory.c.  This file is located in a directory similar to ...

    C:\ti\ccsv6\tools\compiler\ti-cgt-arm_15.12.2.LTS\lib\src

    There is a function at the end of this source file named memmap.  Note this function is under control of the preprocessor symbol MALLOC_DEBUG, which is never defined.  So this function is not normally available.  It is not documented.  No support is available for it.  But it does serve as a model of what you might do to implement your own custom solution for understanding how heap memory is used.

    Thanks and regards,

    -George