iOS SDK memory usage

1871
5
07-21-2014 09:05 PM
marius
by
New Contributor III

Hello,

I noticed that if you zoom/pan the an ESRI web map while the device is in offline mode (airplane mode), the memory usage starts growing. If you're patient enough, the app will crash with 'out of memory' error message.

I've tried doing that while using the leaks instrument. This is the allocations graph after about 20 seconds of zooming around. I was able to reproduce it with a AGSMapView and a AGSWebMap.

esri memory usage.png

Do you know where should I report this?


Thank you.

Marius

Tags (1)
0 Kudos
5 Replies
DiveshGoyal
Esri Regular Contributor

Do you have any offline data (local tiled layers displaying  tile packages, or feature table layers displaying features from a runtime geodatabase) in the map? If not, what's in the map? Does the map go blank when you're navigating it in airplane mode?

0 Kudos
marius
by
New Contributor III

No local tile packages or other features loaded from ESRI. It is a World Street Map (http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer) with a couple of local graphics layers. The map goes blank when the zoom/pan leaves the area that was loaded while the internet connection was on.

0 Kudos
DiveshGoyal
Esri Regular Contributor

I've not been able to repro the crash you report. I used Instruments to monitor the leaks, and all I saw was a few URL related classes being leaked, and that too only once in a while. Which objects do you see being leaked?

The screenshot you shared doesn't show any leak, it shows a stack trace of the functions used to update the map display periodically

0 Kudos
marius
by
New Contributor III

I do not see any objects, in the leaks row. However, the memory usage increases for [AGSRenderer pulse:] and [AGSTiledServiceLayer tileRequestOperation:didFailWithError:] up until the app gets an out of memory error.

It is possible that that memory will be freed, eventually, though.

0 Kudos
DiveshGoyal
Esri Regular Contributor

Yes, memory is used whenever you pan/zoom the map as new tiles are added, but memory is also freed as old tiles are removed. So you would see a churn in the app's object graph, that's expected.

I used Allocations in Instruments to do a generational analysis, where i would navigate the map, then mark objects on the heap as a new generation, navigate the map, mark objects as new gen, over and over again. I would see that as I went on marking new generations, the size of old generations reduce close to 0 bytes. This shows that as the app is allocating new memory, it is also relinquishing older objects that it no longer needs. I did find one or two cases of leaked URL connection objects, and we will look into that, but nothing serious enough to cause a crash or show a significant memory growth over time.