See the screenshot below, this is the only leak the Leaks Instrument finds in my app. Seems odd that main is leaking since it's out-of-the-box. Is this common?
Asked
Active
Viewed 319 times
0
-
1Is it leaking if you actually test it on the device? the simulator is known to be wonky with a few leaks that aren't really leaks... – shawnwall Feb 20 '10 at 21:30
-
1What object gets leaked? – Peter Hosey Feb 20 '10 at 21:34
-
This is how virtually all of Apple's samples define main(). I suspect Leaks is incorrect. – mahboudz Feb 20 '10 at 22:06
-
@sw The original leak was on the simulator but yes, it's also leaking on the device. @Peter Hosey the object type is GeneralBlock-16 and GeneralBlock-8. I have a few more leaks now than I noticed before. The main method is still the only piece of code which is listed in the stack trace though. Everything else is Library code. QuartzCore gets mentioned alot. I'm not sure what I can do next – conorgriffin Feb 20 '10 at 23:28
-
1OK, so it's Core Animation and/or MapKit that's leaking. You should save the trace document and attach it to a bug report in Radar. https://bugreport.apple.com/ – Peter Hosey Feb 21 '10 at 12:36
1 Answers
1
This usually indicates that the leak is occurring somewhere before the app delegate loads. Check any added resources like compiled libraries.
Drag this code source or your app delegate source into Instruments and it might show you the call stack so you can track it down.
Edit01:
See IPHONE: Analyzing leaks with instruments for an example of how to view source in Instruments.
-
Tried this to no avail, not sure I did it correctly as Instruments seemed to ignore the fact that I dropped the code into it. – conorgriffin Feb 21 '10 at 01:38
-
Griffo: Your screenshot shows that you were already viewing the source in Instruments. What you should do is view the call stack for the leak, using the button at the bottom. Chances are, it actually got allocated somewhere deeper. – Peter Hosey Feb 21 '10 at 05:13
-
You have to switch Instruments to the source view. It's the IIRC the rightmost button on the bottom below where the code will appear. – TechZen Feb 21 '10 at 05:17
-
1@Peter Hosey Sorry, I didn't explain myself clearly. See image of call stack above – conorgriffin Feb 21 '10 at 12:04