Search code examples
iphonememory-leaksinstruments

Use of Instruments time line when debugging leaks


I'm trying to fix leaks in a big iPhone game. Some leaks, which only leaks at game init, I'd rather not touch them. Some leaks may happen every frame, which should be fixed.

In the Instruments tool, when debugging leaks, there's a timeline shows "#Leaks Discovered" and "Total Leaked Bytes". When a leak happen, there will be a red line show in the timeline view.

My problem is, how can I know detailed info about that leak indicated by the red line? I tried click on it but nothing happened in the "Leaked Blocks" window.

What can I do about this issue?

Thank you.


Solution

  • Use the inspection range buttons on the trace document window toolbar to focus on the leaks that occur in a specific time range.

    enter image description here

    Click on the timeline where the leak occurs. Click the left inspection range button. Click a second time on the timeline after the leak occurs. Click the right inspection range button. The instruments detail view shows the leaks that occurred in the inspection range you set.