Select to view content in your preferred language

Low memory - process has died

2630
2
03-08-2014 09:04 AM
RudolfKopriva1
Deactivated User
I have 5 custom tiled service layers, each is displaying 1024x1024 png tiles. It looks like the device runs out of memory after a while and the application is killed. I was not able to find any way how to avoid the crash. I tried to cancel all pending tasks and clear each tiled layer when onLowMemory or onTrimMemory happens. It helps for a while, but then it crashes on zooming.
How can I avoid the low memory crash or how can I detect how many layers can be loaded?

Thanks.
0 Kudos
2 Replies
RudolfKopriva1
Deactivated User
What exactly is the life cycle of getTile method?
I see that the application is killed, because the application heap size is critical and I can see the allocation there. I thought that once I return byte array in the getTile method that array is allocated in the native heap and released from the application heap. However it looks like it's still being referenced. When exactly is the byte array released?
0 Kudos
RudolfKopriva1
Deactivated User
The problem seems to happen on devices with Android 4.1.2 and lower. It works fine after I updated device to Android 4.3. Unfortunatelly some devices cannot be updated to 4.3.
0 Kudos