5

I am making an iOS app which uses SKMap (Skobbler). My app consume lots of memory when SKMap opens. More over it doesn't release the memory when i move to other page of the application.

I put some code in viewWillDisappear method to release memory of SKMap,

[[SKRoutingService sharedInstance].mapView clearAllAnnotations];
[SKRoutingService sharedInstance].routingDelegate = nil;
[SKRoutingService sharedInstance].navigationDelegate=nil;
[[AudioService sharedInstance]cancel];
[[SKRoutingService sharedInstance]stopNavigation];
[[SKRoutingService sharedInstance]clearCurrentRoutes];
[[SKRoutingService sharedInstance]clearAllRoutesFromCache];
[SKRoutingService sharedInstance].mapView = nil;

//self.mapView is SKMap
self.mapView.settings.displayMode = SKMapDisplayMode2D;
self.mapView.delegate=nil;
[self.mapView removeFromSuperview];
self.mapView=nil;

If you have any solution to release memory for this, please help me.

Vivek Shah
  • 430
  • 5
  • 22
  • I am seeing a similar problem which is causing my application to crash on iPhone 4S - do you have an allocations trace from profiling with Instruments? Also which version of the SDK are you using? – Stephen Mason Jun 30 '15 at 09:54

1 Answers1

0

I wrote them to ask about this, received this reply:

Internally the C++ code uses 1 map singleton and will hold the map instance active even after the iOS map view is destroyed – you cannot force the C++ library to release the memory at the iOS/Android level. This implementation decision was taken back in the days when it was considered more important to have a speedy "map restore" procedure than a small memory footprint.

Drew
  • 8,675
  • 6
  • 43
  • 41