2
votes

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.

1
Just out of curiosity - why not fix ALL leaks?Mihai Fratu
@Mihai Fratu, because a)most of them only leak once, the total number is acceptable for a game uses 30+MB memory, b)we have already delayed more than one month, we really want to finish this project before iPhone 5 being released.Zhao Xiang
You could try analyzing your project with XCode (COMMAND + SHIFT + B if it's XCode 4). It should let you know where your leaks take place in your code and only fix the ones that are part of your 'every frame' code...Mihai Fratu

1 Answers

2
votes

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.