Search code examples
iosobjective-cxcode-instruments

How do you see when memory was released in Instruments 8.2


I've seen old screen shots of previous versions of instruments and there appear to be calls to 'free' along with calls to 'malloc' in the Allocations list.

This doesn't seem to be the case anymore.

I have tried not 'excluding' free events, but that doesn't appear to show free calls either.

enter image description here

How do you see when memory was freed now?


Solution

  • You have to configure Instruments to keep the free events. First, make sure the Discard events for freed memory checkbox is not selected.

    enter image description here

    Second, set the allocation lifespan to Created and Destroyed.

    enter image description here

    To see free events in Instruments, you must drill down to a specific memory address. Instruments does not provide a list of free events. In the allocations summary, move the mouse cursor over a category. A button with an arrow will appear.

    enter image description here

    Click that button to see a list of memory allocations for that category. Move the mouse cursor over a memory address to bring up another with an arrow.

    enter image description here

    Click the button to see all the memory events for that address. This is where you find the free events.

    enter image description here