I have a MKMapView
managed in certain UIViewController
. This view controller is pushed/popped from a UINavigationController
. When running the app with Xcode's Intruments to see the memory allocations and look for leaks, I find that, starting from a certain Live Bytes
value, when I navigate to such view controller with a map view, and then I navigate back, the view controller is deallocated but the Live Bytes
value I had before navigating forth is always incremented more or less the same amount of bytes.
I've navigated forth and back from the view controller with the map several times in a row to show you the values: the screenshots were taken once navigated back from the view controller.
I "nilify" all view controller's views and subviews in viewDidUnload
delegate method, and I also "nilify" strong properties and remove map's annotations and overlays in viewWillDisappear:
. What could be causing that increment in Live Bytes
every time I navigate back from this view controller? Is it because of the map view itself?
The screenshots are from a device running iOS 6.1
Thanks in advance
EDIT: the leaks graph in Instruments is "clean":
EDIT 2: I've tested the same scenario in a device running iOS 7.1 and I don't see the increment in Live Bytes
when navigating back. It seems to be an issue related to iOS 6, and I found some posts dealing with it:
How to resolve the memory issue with Map on iOS 6
MKMapView memory usage steadily increasing
However, I don't find a solution, is it actually an iOS 6.X bug?
EDIT 3: I tried the following solutions, but still get the same values in Instruments:
I don't get any memory warning, though.