Stuck in memory leaks in my project
I am using UIImage picker, Local notification, event calendar, Date Picker , Facebook Sharing, Sounds, Navigation controller , database . My application is crash after some time, the reason is not same, Some times memory is full and some times too manny other receive memory warning. Please guide me how can i general开发者_开发知识库ly remove the leaks?
Have a look at this Cocoa Tutorial: Fixing Memory Leaks With Instruments. Instruments is the way to go to find leaks.
More resources:
- Finding iPhone Memory Leaks: A “Leaks” Tool Tutorial
- Apple's official Memory Usage Performance Guidelines / Finding Memory Leaks
Use Intstruments with the Leaks profile... see this article Leaks!
1.first of all release the objects in the dealloc . 2.Go to the xcode there in mainmenu you find the build tab.In that pressed on the build and analyze .It gives the errors.Remove those warnings.
If you are using autorelease
objects, make sure it gets released at the right time. If you can,try not to use Interface Builder
, i feel something is fishy abt it when it comes to memory.
Check the NSString
objects, they can have devastating effects if not released on time.
also remember [UIImage imageNamed@"abc.png"]
caches the images which also causes running low memory warnings.
Try to create your view hierarchy programmatically.
精彩评论