I have yet to find an elegant solution for this. I have a class with a method I want to track the memory usage of without modifying the function:
class Example {
The XHProfLive profiler developed by the Facebook guys gives this degree of function/method-level profiling, and available as a PECL download.