Question

Is there any way to check/debug memory leaks and any memory related crash by changing few Build settings? It would be better if I get any memory warnings.

Was it helpful?

Solution

When your application gets a memory warning, the following method is called. In this method you can deallocate any views or object instances that you are not using anymore to clear memory.

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; 
}

You can check for memory leaks using the leaks instrument in Xcode. It is the best way. You can also check for memory allocations and whether memory is deallocated properly using allocations tool. Else, the simplest way is to run your app and check the app's memory usage in the activity monitor. This method can be used to find out where you are allocating maximum memory. Also you can run "analyze" by holding the run button. It will also help you find memory leaks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top