Heap profiling on ARM
===

I am developing a GUI-heavy C++ application on a Freescale MX51-based board. The platform is highly resource constrained- 800mhz, 512MB of RAM, running Linux 2.6.35. These resource constraints have become a large problem for me, in particular the platform's low RAM availability. I would like to better understand the heap usage patterns of my application over time- **I would like to perform heap profiling.**

Unfortunately, all heap profiling tools I have found have either been too intrusive or ostensibly non-working on ARM. Specific tools I've tried:

 - **[Valgrind Massif][1]**: unworkable on my platform due to the platform's feeble CPU. The 80% CPU time overhead introduced by Massif causes a range of problems in my application that cannot be compensated for. 
 - **[gperftools][2]** (formerly Google Performance Tools): All features of this rather un-intrusive, library-based `libc malloc()` replacement work on my target *except* for the heap profiler. To rephrase, the thread caching allocator works but the profiler does not. I'll explain the failure mode of the profiler below for anyone curious. 


Can anyone suggest a set of replacement tools for performing C++ heap profiling on ARM platforms? Ideal output would ultimately be a directed allocation graph, similar to what gperftools' tcmalloc outputs. Low resource utilization is a must- my platform is highly resource constrained. 


----------


**Failure mode of tcmalloc explained:**

I'm providing this information only for those that are curious; I do not expect a response. I'm seeing something similar to issue #407 below, except on ARM rather than x86. 
Specifically, I always get the message "Hooked allocator frame not found, returning empty trace." I spent some time debugging the issue and it appears that, when dynamically linking the tcmalloc library, frame pointers at the boundary between my application and the dynamic library are null- the stack cannot be walked "above" the call into the dynamic library. 

Issue #407: hxxp://code.google.com/p/gperftools/issues/detail?id=407

  [1]: http://valgrind.org/docs/manual/ms-manual.html
  [2]: http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html