1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

How can I know where leaked memory is?

Discussion in 'iPhone/iPad Programming' started by mikezang, Aug 22, 2010.

  1. macrumors 6502a

    #1
    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?
     

    Attached Files:

  2. Moderator

    dejo

    Staff Member

    #2
    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.
     
  3. macrumors 6502a

    #3
    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?
     

    Attached Files:

  4. macrumors regular

    #4
    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.
     
  5. macrumors 6502a

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

    You mean old version show toolbar at bottom and I am using new version that toolbar is at top?
     
  6. macrumors regular

    #6
    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.
     

Share This Page