PDA

View Full Version : How can I know where leaked memory is?




mikezang
Aug 22, 2010, 06:55 AM
I run my app with Instrument and I got some info about leaked memory, but it doesn't tell me which code made the leaked, how can I know where is the leaked in?



dejo
Aug 22, 2010, 10:16 AM
Wirelessly posted (Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16)

Try Build and Analyze.

mikezang
Aug 27, 2010, 10:14 AM
It is said there is a toolbar at the bottom of screen as below, but I can't find that toolbar, how can I show that toolbar?

zerocustom1989
Aug 27, 2010, 03:31 PM
So I thought instruments only shows you where the memory is allocated. This means that It wont show you that you didnt de-allocate, just that you allocated it. Idk, I pretty much ignore most of what instruments tells me unless I have crashes.

Build>Analyze finds most of the stuff that would get me into trouble.

Just be sure most of your @synthesize stuff gets released too cause build > analyze doesn't always pick those up.

EDIT: also that toolbar is there in the picture you posted in your firstpost, just at the top of the list instead of the bottom.

mikezang
Aug 27, 2010, 11:59 PM
So I thought instruments only shows you where the memory is allocated. This means that It wont show you that you didnt de-allocate, just that you allocated it. Idk, I pretty much ignore most of what instruments tells me unless I have crashes.

Build>Analyze finds most of the stuff that would get me into trouble.

Just be sure most of your @synthesize stuff gets released too cause build > analyze doesn't always pick those up.

But why only three allocations are displayed? I think there are a lot of allocation in my app.


EDIT: also that toolbar is there in the picture you posted in your firstpost, just at the top of the list instead of the bottom.
You mean old version show toolbar at bottom and I am using new version that toolbar is at top?

zerocustom1989
Aug 28, 2010, 04:44 PM
But why only three allocations are displayed? I think there are a lot of allocation in my app.

I think it's because these allocations deal with elements created via a .xib file. I havent figured it out myself, but I get about 100+ "leaks" via instruments, yet my app doesn't crash or have memory errors. None of the leaks are even traceable back to code that I've written myself. This leads me to believe that the allocations occurred when the xibs are use internally.

I really dont know if that's true, but it hasn't stopped apple from approving my app and update.