I have an Oculus Go app that is crashing for people with disturbing frequency. Some users know how to adb logcat, and what they send me looks like this.
02-08 10:41:22.774 29130 29188 I VrApi : FPS=49,Prd=56ms,Tear=0,Early=0,Stale=25,VSnc=1,Lat=1,Fov=3,CPU2/GPU=4/4,1593/510MHz,OC=F,TA=E/0/0,SP=F/N/N,Mem=1804MHz,Free=346MB,PSM=0,PLS=0,Temp=31.0C/25.0C,TW=1.03ms,App=16.71ms,GD=0.00ms
02-08 10:41:22.943 29130 29173 W Adreno-GSL: <sharedmem_gpuobj_alloc:2633>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
02-08 10:41:22.945 29130 29173 E Adreno-GSL: <gsl_memory_alloc_pure:2265>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
(… repeats many times …)
02-08 10:41:23.525 29130 29173 W Adreno-GSL: <sharedmem_gpuobj_alloc:2633>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
02-08 10:41:23.526 29130 29173 E Adreno-GSL: <gsl_memory_alloc_pure:2265>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
02-08 10:41:23.526 29130 29153 E CRASH : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00020100
02-08 10:41:23.526 29130 29153 E CRASH : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-08 10:41:23.526 29130 29152 E CRASH : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0004c5c0
02-08 10:41:23.526 29130 29152 E CRASH : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-08 10:41:23.526 29130 29153 E CRASH : Build fingerprint: ‘oculus/vr_pacific/pacific:7.1.2/N2G48H/223630.5280.0:user/release-keys’
02-08 10:41:23.526 29130 29152 E CRASH : Build fingerprint: ‘oculus/vr_pacific/pacific:7.1.2/N2G48H/223630.5280.0:user/release-keys’
02-08 10:41:23.526 29130 29153 E CRASH : Revision: ‘0’
02-08 10:41:23.526 29130 29152 E CRASH : Revision: ‘0’
02-08 10:41:23.526 29130 29152 E CRASH : pid: 29130, tid: 29152, name: Worker Thread >>> com.alvios.quivr <<<
02-08 10:41:23.527 29130 29153 E CRASH : pid: 29130, tid: 29153, name: Worker Thread >>> com.alvios.quivr <<<
02-08 10:41:23.527 29130 29152 E CRASH : r0 4221420f r1 00000001 r2 0004c5c0 r3 00000000
02-08 10:41:23.527 29130 29153 E CRASH : r0 4221e4d4 r1 00000001 r2 00020100 r3 00000000
02-08 10:41:23.527 29130 29152 E CRASH : r4 cadff6b0 r5 cadff280 r6 cadff280 r7 cadfeb70
02-08 10:41:23.527 29130 29153 E CRASH : r4 cac7f6b0 r5 cac7f280 r6 cac7f280 r7 cac7eb70
02-08 10:41:23.527 29130 29152 E CRASH : r8 cadff738 r9 00000000 sl cadff5f0 fp cadfec88
02-08 10:41:23.527 29130 29153 E CRASH : r8 cac7f738 r9 00000000 sl cac7f5f0 fp cac7ec88
02-08 10:41:23.527 29130 29152 E CRASH : ip 00000000 sp cadfeaf0 lr c36c9510 pc cd751490 cpsr e6f5ac90
02-08 10:41:23.527 29130 29153 E CRASH : ip 00000000 sp cac7eaf0 lr c36c59f0 pc cd751490 cpsr e6f57c90
02-08 10:41:23.527 29130 29152 E CRASH :
02-08 10:41:23.527 29130 29152 E CRASH : backtrace:
02-08 10:41:23.527 29130 29153 E CRASH :
02-08 10:41:23.527 29130 29153 E CRASH : backtrace:
02-08 10:41:23.529 29130 29145 E CRASH : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00059700
02-08 10:41:23.529 29130 29145 E CRASH : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-08 10:41:23.529 29130 29145 E CRASH : Build fingerprint: ‘oculus/vr_pacific/pacific:7.1.2/N2G48H/223630.5280.0:user/release-keys’
02-08 10:41:23.529 29130 29145 E CRASH : Revision: ‘0’
02-08 10:41:23.529 29130 29145 E CRASH : pid: 29130, tid: 29145, name: UnityMain >>> com.alvios.quivr <<<
02-08 10:41:23.529 29130 29145 E CRASH : r0 421a8b2a r1 00000001 r2 00059700 r3 00000000
02-08 10:41:23.529 29130 29145 E CRASH : r4 e705e000 r5 e705dbd0 r6 e705dbd0 r7 e705d4c0
02-08 10:41:23.529 29130 29145 E CRASH : r8 e705e088 r9 00000000 sl e705df40 fp e705d5d8
02-08 10:41:23.530 29130 29145 E CRASH : ip 00000000 sp e705d440 lr c36ca6a0 pc cd751490 cpsr e719ac90
02-08 10:41:23.530 29130 29145 E CRASH :
02-08 10:41:23.530 29130 29145 E CRASH : backtrace:
02-08 10:41:23.545 29130 29173 W Adreno-GSL: <sharedmem_gpuobj_alloc:2633>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
02-08 10:41:23.545 29130 29173 E Adreno-GSL: <gsl_memory_alloc_pure:2265>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
So it seems like it’s running out of GPU memory, I guess? But I’m not certain I’m interpreting it correctly. Nor do I see why that causes a crash rather than something like pink materials.
Any tips on how to narrow this down, and what I can do about it?
In case it’s useful, here’s the result of adb shell dumpsys meminfo
on my device after playing a while. (I did not experience a crash, however.)
Applications Memory Usage (in Kilobytes):
Uptime: 739145165 Realtime: 925678597
** MEMINFO in pid 28970 [com.alvios.quivr] **
Pss Private Private SwapPss Heap Heap Heap
Total Dirty Clean Dirty Size Alloc Free
------ ------ ------ ------ ------ ------ ------
Native Heap 602902 602772 0 0 642560 621237 21322
Dalvik Heap 4577 4156 0 0 9933 5960 3973
Dalvik Other 711 708 0 0
Stack 1004 1004 0 0
Ashmem 16 4 0 0
Gfx dev 470520 409952 0 0
Other dev 8 0 8 0
.so mmap 16584 500 14060 0
.jar mmap 4 0 4 0
.apk mmap 7700 340 3368 0
.dex mmap 2197 12 1920 0
.oat mmap 4954 0 2352 0
.art mmap 3388 1568 588 0
Other mmap 68 4 28 0
EGL mtrack 29600 29600 0 0
Unknown 25326 25312 0 0
TOTAL 1169559 1075932 22328 0 652493 627197 25295
App Summary
Pss(KB)
------
Java Heap: 6312
Native Heap: 602772
Code: 22556
Stack: 1004
Graphics: 439552
Private Other: 26064
System: 71299
TOTAL: 1169559 TOTAL SWAP PSS: 0
Objects
Views: 6 ViewRootImpl: 1
AppContexts: 2 Activities: 1
Assets: 3 AssetManagers: 2
Local Binders: 29 Proxy Binders: 26
Parcel memory: 15 Parcel count: 60
Death Recipients: 2 OpenSSL Sockets: 2
WebViews: 0
No ideas?
What about some way to measure how much GPU memory is in use (ideally, as a percentage of total), at runtime, so I can see whether my efforts at optimization are having any effect?
(I did go through with Resource Checker and reduce all my texture sizes; most of them are 1k by 1k now. But the crash is still occurring.)