1 Reply Latest reply: Aug 1, 2008 11:04 AM by Daniel Morais
David Dennis Level 1 Level 1 (45 points)
I would like to associate the code I'm executing with a specific memory consumption figure.

That is, I would like to do something like this:

-(void) function
{
long memory_status = sizeofheap();
long newmemorystatus;

dosomestuff();

newmemorystatus = sizeofheap();
NSLog(@"We've done new stuff, and our stack was %ld bytes long and now we have %ld bytes, or a difference of %ld",
memory_status, newmemorystatus, memory_status - newmemorystatus);
}

I don't know why but I have done millions of searches and still have no clue as to how to do this ... and yet there must be a way ... right?

Or is there any way to do this?

markininstruments("Where we start"); and have "where we start" appear somewhere in instruments as a marker I could visit, like markers in Final Cut Pro?

It seems extremely difficult for me to associate a specific time in Instruments to code executing and I've spent hours and hours on this problem without any success.

Many thanks for any ideas.

D

MacBook Pro 2.4ghz; iPhone with version 2.0 software, Mac OS X (10.5.4)