Graphic memory usage is increasing untill app crashes

313
2
Jump to solution
05-12-2021 05:16 AM
gayedurmaz
New Contributor II

Hi everyone,

I am developing an android app with using Esri Runtime SDK 100.10.0 version. And I am struggling with memory management.

I realised that MapView's resume() method causes graphic memory increase. And that increase continues until app crashes.  During my tests, I was able to crash my app by using just mapview.pause() and mapview.resume() .

I am also attaching the screenshot I took from the profiler regarding the memory situation I mentioned.

I don't understand. Shouldn't the graphic memory used after at some point be cleared?

memory usage.PNG

I am beginner for Esri and Android so any advice you can give will be useful to me.

Thanks in advance,

Happy coding :)

0 Kudos
1 Solution

Accepted Solutions
RamaChintapalli
Esri Contributor

Hi,

Can you share any code on how the view is being managed in your android activity? The MapView along with layers when rendering is expected to allocate memory (include the native memory). 

The activity lifecycle should  honor pause, resume and destroy of the MapView accordingly. Do you see the same behavior when profiling this sample?
https://github.com/Esri/arcgis-runtime-samples-android/tree/main/java/display-map

Thanks
Rama

View solution in original post

0 Kudos
2 Replies
RamaChintapalli
Esri Contributor

Hi,

Can you share any code on how the view is being managed in your android activity? The MapView along with layers when rendering is expected to allocate memory (include the native memory). 

The activity lifecycle should  honor pause, resume and destroy of the MapView accordingly. Do you see the same behavior when profiling this sample?
https://github.com/Esri/arcgis-runtime-samples-android/tree/main/java/display-map

Thanks
Rama

View solution in original post

0 Kudos
gayedurmaz
New Contributor II

Hi, 

I am grateful for your answer. 

When I use the example you gave, no graphics were drawn on the screen, but when I triggered the onPause() and onResume() methods, I saw a stable memory usage. I think my problem occurs while drawing graphics on the screen.
Thank you for the codes you shared helped me understand the source of the problem.

Happy coding!

Gaye.

0 Kudos