You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 25, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 25, 2023. It is now read-only.
My app has a view controller for presenting an MBXMapView. The view is defined using a XIB that contains a main view and an MBXMapView-class subview. The MBXMapView view's referencing outlet and delegate are set to the view controller. Here's the view controller's interface:
It’s a navigation controller-based app, so I present the map to the user by pushing the map view controller onto the navigation stack. The map correctly appears and displays the online tiles; however, after pushing and popping the controller several times, app memory seems to be accumulating. Monitoring the allocations in Instruments, there are 2 MBXMapViewTileOverlay objects created each time the map view controller is created, one by -[MBXMapView MBXMapView_commonSetupWithMapID:showDefaultBaseLayerMode:] and one by __27-[MBXMapView updateOverlay]_block_invoke_2. When the map view controller is popped and deallocated, the 2 MBXMapViewTileOverlay objects remain in memory. In the code I don’t immediately see what might be holding a strong reference to them. Is this a bug, or am I not creating the map view properly? Thanks!
Thanks. Regarding setting the delegate, the example I gave above was a minimal one to demonstrate the bug, and my actual map view controller needs to respond to updates in user location and interactions with map annotations. Actually, I need support for displaying offline tile sets, and discovered the bug while testing your fork adding support for MBTiles, which I was interested in since there are also some memory management issues in the Mapbox iOS SDK (e.g., mapbox/DEPRECATED-mapbox-ios-sdk#221). The advice about minimizing the number of map view allocations is good and I'm doing that to some extent already to improve performance, although not at the root level view controller. Thanks for your advice and hard work!
Thanks for the updates here. I'm going to close this for now as we work through some core issues in the way that the main "overlay" is done and eventually possibly add support for additional overlays. Let's let the dust settle a bit and then profile/static analyze/check this again?
Activity
jrmatchett commentedon Feb 4, 2014
Thanks. Regarding setting the delegate, the example I gave above was a minimal one to demonstrate the bug, and my actual map view controller needs to respond to updates in user location and interactions with map annotations. Actually, I need support for displaying offline tile sets, and discovered the bug while testing your fork adding support for MBTiles, which I was interested in since there are also some memory management issues in the Mapbox iOS SDK (e.g., mapbox/DEPRECATED-mapbox-ios-sdk#221). The advice about minimizing the number of map view allocations is good and I'm doing that to some extent already to improve performance, although not at the root level view controller. Thanks for your advice and hard work!
incanus commentedon Feb 18, 2014
Thanks for the updates here. I'm going to close this for now as we work through some core issues in the way that the main "overlay" is done and eventually possibly add support for additional overlays. Let's let the dust settle a bit and then profile/static analyze/check this again?