views:

33

answers:

1

I'd like to show the memory peak (not 'leak', but the highest quantity of memory used in small amount of time) of an iPhone app i am running in the simulator. Where shall i look precisely? PS I am using libxml2 and i suppose that the allocations done by the library aren't considered

+1  A: 

Use the "Allocations" performance tool by selecting Run | Run with Performance Tool | Allocations in Xcode. This will show you everything that your app allocates including items in libxml2. You may not to see exact line numbers of memory allocations in the library, but you will be able to see where the majority of your allocations are happening.

Matt Long
Ok thanks, do you know if i can set a breakpoint or something similar to stop the execution and get a clear visualization? My intention is to check the memory footprint in a small amount of time
rano
You will only be able to set break points where you have debug information, which means that you won't be able to break anywhere inside the libxml2 library. Everything up to that point is fair game though, and you will be able to see all the symbols that are available. What are you looking for? I generally use Allocations to find places where I'm holding onto objects longer than I need to. It's useful because those are valid objects that aren't leaking. They just have a longer life span than is necessary. Is that what you're looking for?
Matt Long
Yeah you are right, I discovered the 'Heapshot' function that is really helpful in detecting still living but non used objects (even if I have to become more skilled in using it)
rano