Application is crashing on android 7

Hi,
We created mobile app using cordova and ionic. The main part of application is map which is implemented with openlayers3. On map there is one raster layer and pretty many vector layers. Those vector layers geoemtries are loaded from local spatialite database. After playing for some time with map (zooming,panning, switching off/on layers) app crashes. It didn’t happen on previous Android 6. The direct error says “out of memory” and probably comes from webview. I tried diffrent webviews => crosswalk, chrome, system component, app is always eventually crashing.
I am not sure if this the right place to write (I am not sure what is the correct cause of crash) but I am out of ideas at the moment, so maybe here someone faced similar problems.
I am using cordova 6.2.0 (however did try also with 6.5.0 and also crashing),cordova android 6.1.2. I made my tests on S7 Edge 935F Android 7.0.

Begin of tombstone with Chromium web view:
Build fingerprint: 'samsung/hero2ltexx/hero2lte:7.0/NRD90M/G935FXXU1DQB3:user/release-keys’
Revision: '9’
ABI: 'arm’
pid: 20884, tid: 20929, name: Chrome_InProcRe >>> com.example.test <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:memory_linux.cc(35)] Out of memory.
'
r0 00000000 r1 000051c1 r2 00000006 r3 00000008
r4 c7f77978 r5 00000006 r6 c7f77920 r7 0000010c
r8 ebc59008 r9 c7f7436c sl 00000000 fp 00000000
ip 0000000c sp c7f73ec0 lr ebc138c7 pc ebc16130 cpsr 680f0010
d0 726f6d656d3a4c65 d1 2e78756e696c5f6d
d2 205d29353328636f d3 6d20666f20747572
d4 00000000bd116400 d5 43b46ecb43b47007
d6 bf128ff400000000 d7 3c1e00003bcac000
d8 426c26d5000000c3 d9 4090000043b856ba
d10 4070000000000000 d11 4070000000000000
d12 0000000044b40000 d13 0000000000000000
d14 0000000000000000 d15 000000000003e800
d16 2e74736973726570 d17 2e6761742e676f6c
d18 3e7c100000000000 d19 40768e00e0000000
d20 4042db86a0000000 d21 434373ba3f378d12
d22 43b85649426c26d5 d23 43b856ba426c250b
d24 0000000000000000 d25 0000000000000000
d26 0000000000000000 d27 0000000000000000
d28 3ff0000000000000 d29 0000000000000000
d30 0000000000000000 d31 0000000000000000
scr 20000013

backtrace:
#00 pc 0004a130 /system/lib/libc.so (tgkill+12)
#01 pc 000478c3 /system/lib/libc.so (pthread_kill+34)
#02 pc 0001d955 /system/lib/libc.so (raise+10)
#03 pc 000194a1 /system/lib/libc.so (__libc_android_abort+34)
#04 pc 000170e8 /system/lib/libc.so (abort+4)
#05 pc 008fa231 /system/app/Chrome/Chrome.apk (offset 0x4236000)

So, it means your app is doing so much that you’re running out of allocated ram so it’s forcing it to quick instead of crashing the entire OS.

The only things I can think to recommend are:
1- Don’t do so much in the app, see what you can optimize
2- Make sure you don’t have plugins that you don’t need
3- Use some android debugging tools to monitor memory usage and that may help identify what specifically is causing it to go so high

If this is happening on a new flagship phone, it’s sure to almost instantly crash on any other android that has less available memory.

Hi, thanks for suggestions. I will try some of those.

Hi,

Did you find any solution for your issue ? I am facing the same kind of issue. i’ve used ionic’s infinite scroll to load text/image/video in a list. App works fine on all ios and android devices but it crashes on Nexus 6(7.1.1) while scrolling. It crashes on real device only not emulator. Below is the logcat of the crash:

05-03 12:12:34.089 13695-13820/com.swingbyswing.clubby W/Adreno-GSL: <sharedmem_gpumem_alloc_id:2372>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
05-03 12:12:34.090 13695-13820/com.swingbyswing.clubby E/Adreno-GSL: <gsl_memory_alloc_pure:2115>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
05-03 12:12:34.094 13695-13820/com.swingbyswing.clubby W/Adreno-GSL: <sharedmem_gpumem_alloc_id:2372>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
05-03 12:12:34.095 13695-13820/com.swingbyswing.clubby E/Adreno-GSL: <gsl_memory_alloc_pure:2115>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
05-03 12:12:34.105 13695-13820/com.swingbyswing.clubby W/Adreno-GSL: <sharedmem_gpumem_alloc_id:2372>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
05-03 12:12:34.105 13695-13820/com.swingbyswing.clubby E/Adreno-GSL: <gsl_memory_alloc_pure:2115>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
05-03 12:12:34.110 13695-13820/com.swingbyswing.clubby E/chromium: [ERROR:texture_manager.cc(3408)] [.RenderWorker-0x8099dc00]GL ERROR :GL_OUT_OF_MEMORY : glTexImage2D:
05-03 12:12:34.115 13695-13820/com.swingbyswing.clubby E/chromium: [ERROR:gles2_cmd_decoder.cc(5409)] Error: 5 for Command kTexImage2D
05-03 12:12:34.116 13695-13820/com.swingbyswing.clubby E/chromium: [ERROR:gles2_cmd_decoder.cc(4382)] GLES2DecoderImpl: Trying to make lost context current.
05-03 12:12:34.249 13695-13739/com.swingbyswing.clubby E/chromium: [ERROR:gles2_cmd_decoder.cc(9881)] [GroupMarkerNotSet(crbug.com/242999)!:50B09379]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.

--------- beginning of crash

05-03 12:12:34.418 18423-13739/? A/google-breakpad: -----BEGIN BREAKPAD MICRODUMP-----
V AndroidWebView:63.0.3239.111
O A arm 04 armv7l google/shamu/shamu:7.1.1/N6F27M/4299435:user/release-keys
P webview
R 0000000B SIGSEGV 00000004
G
05-03 12:12:34.437 18423-13739/? A/google-breakpad: H 0083C000 BE984000 01A4 03A90000 16EEA000 0C:17 0D:1C 0E:29 0F:40 10:1B 11:27 12:28 13:7A 14:08 15:07 16:0B 17:06 18:03 19:01
05-03 12:12:34.439 18423-13739/? A/google-breakpad: S 0 86CC90F0 86CC9000 00002000
05-03 12:12:34.440 18423-13739/? A/google-breakpad: S 86CC9000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000EDACEF0D0000000000000000C005000060020000EDACEF0DEDACEF0DEDACEF0D3091CC86EDACEF0D02000000000000000E000000130200003512F798EDACEF0D02000000E10D000000000000EDACEF0DEDACEF0DEDACEF0DEDACEF0D00000000EDACEF0D00000000000000000000000000000000000000000000000000000000000000000000000000000000
S 86CC9180 0000000000000000EDACEF0D000000000000000000000000C005000060020000EDACEF0DEDACEF0DEDACEF0D01

Thanks

Hi,
in our case problem was related with map and layers rendering .We had to optimize our rendering engine , we started with stopping recreation of some objects. It wasn’t any configuration or plugin issue.
Maybe in your case similar thing is happening, some objects are recreated when scrolling.

Hi,

Yes, this might be the case. But, what’s surprising is that the crash is only happening on Nexus Devices(7.1.1) and now i can’t decide if it is a device issue or there’s something wrong in the code.

Thanks