Application description:

1.      The application consists of a mapView and tableview and few buttons to view the current location,display favorite item etc.,
2.      The mapView is implemented using MKMapKit framework.
3.      There will be addresses shown in the table view with thumbnail images in the table view cells which are loaded from the URL.The addresses are taken from a SQLITE DB.
4.      There are different categories of addresses.
5.      Those addresses will be plotted in the map view  using different customized pins according to the address category.
6.      We can also tap a particular pin to see the small description about that in an annotation view on the map.
7.      Images and address detail are retrieved from the DB and stored in a class and referred using the class instance across the application.
8.      I have reduced the image sizes which I have used in the instance of class to populate it on the UITableView.


The application runs perfectly in the simulator.

But when tried to run on the iPad,The application runs perfectly for few minutes.Then it starts to behave in the following way:

All buttons in the screen doesn't respond to the touch events after receiving memory warnings.

1.Memory warning.
2.Received memory warning Level 1.
3.Received memory warning Level 2.

The memory warnings are displayed multiple times in the console after that the application crashes.

Approaches undertaken:

Initially I thought the problem with the MKMapView cached tiles. So I have used following code in  mapViewWillStartLoadingMap: delegate method.

 - (void)mapViewWillStartLoadingMap:(MKMapView *)mapView {     NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];     [NSURLCache setSharedURLCache:sharedCache];     [sharedCache release]; }                             
1: 2: 3: 4: 5: 

Select allOpen in new window

After this also, the application receives memory warnings. So I don't know what is the problem exactly.

asked 11/29/2011 12:06

CGVAK's gravatar image


3 Answers:
Hard to tell from just your application description but you obviously have a memory leak somewhere. I'd say start by running the Analyser (hold down the Run button then choose Analyse) to see if you have any memory leaks. If you can't find the answer there, try the Profiler (again hold down the Run button but choose Profiler) and use the Activity Monitor, which will show you exactly what's eating your memory.


Snapples's gravatar image


It gave us an idea to fix the issue. Thank you

answered 2011-12-10 at 14:33:10

CGVAK's gravatar image


And whatvwascthe fix !

answered 2011-12-14 at 12:59:17

Tease27's gravatar image


Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



Asked: 11/29/2011 12:06

Seen: 431 times

Last updated: 12/14/2011 04:59