Hello,
Our app dies on a “low specs” device (iRulu X9), a device running Android 4.4.2 with 1G of RAM. The app works fine on other devices with 1G of RAM (although running Android >= 5).
After spending a good part of the day on it, I suspect the problem is related to memory. But I find no exact explanation.
Here are some details:
The crash is silent. No special stack or signal written in the logcat. It crashes consistently during the load of the main scene of the game, albeit at different positions depending on what I try.
I/Unity (27261): **** MonoHeapSize: 2240512 MonoUsedSize: 1327104 TotalAllocatedMemory: 145739845 TotalReservedMemory: 149218619 TotalUnusedReservedMemory: 3478774 usedHeapSize: 145739845
I/Unity (27261): UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
I/Unity (27261): UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
I/Unity (27261): UnityEngine.Logger:Log(LogType, Object)
I/Unity (27261): UnityEngine.Debug:Log(Object)
I/Unity (27261): WWTK.Util.TroubleshootUtil:smile:umpMemoryInfo(String) (at.....)
I/Unity (27261):
I/wpa_supplicant(19117): [CTRL_IFACE]wlan0: SIGNAL_POLL
D/Unity (27261): Setting up 1 worker threads for Enlighten.
D/Unity (27261): Thread -> id: 6cafa040 -> priority: 1
I/ActivityManager( 488): Process com.google.android.gms.persistent (pid 26674) has died.
I/ActivityManager( 488): Process com.google.android.gms (pid 26717) has died.
I/ActivityManager( 488): Process com.google.process.gapps (pid 26689) has died.
I/wpa_supplicant(19117): [CTRL_IFACE]wlan0: SIGNAL_POLL
D/Unity (27261): Unloading 25 Unused Serialized files (Serialized files now loaded: 0)
I/ActivityManager( 488): Process com.Company.App (pid 27261) has died.
W/ActivityManager( 488): Force removing ActivityRecord{42394c28 u0 com.Company.App/com.unity3d.player.UnityPlayerNativeActivity t83}: app died, no saved state
W/InputDispatcher( 488): channel '42f645f0 com.Company.App/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
E/InputDispatcher( 488): channel '42f645f0 com.Company.App/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
W/MediaFocusControl( 488): AudioFocus audio focus client died
The fact that other apps die makes me think that the device has a memory issue and starts killing apps.
I am not sure if it is possible to enable more verbose logging for Unity ? I tried adb logcat ‘Unity:V’. No use.
The code loads several components into the scene, by adding them additively. Those components load several textures. We use Sprite Packers.
I saw that one atlas was rather large in the uncompressed set of textures:
28.0 mb 12.5% Built-in Texture2D: SpriteAtlasTexture-House (Group 1)-2048x2048-fmt4
I’ve tried changing out texture settings, creating several atlasses and grouping textures differently. Now the largest uncompressed texture is 12mb. It doesn’t help. It even crashes earlier. I don’t see big differences in the profiling information I dump when inside the editor.
I’ve experimented with lots of things: disabling static batching, forcing openGL 2.0, using Quarter Res Textures (but as we don’t have mip maps enabled, it doesn’t help), go from Async to Sync loading, use NativeAndroid integration in AndroidManifest.xml and more. I searched for leaks but find no obvious candidates.
Any idea on how to find more information about this crash?
How can I validate my assumption that the problem is memory related?
Has anyone had weird issues with Sprite Packing on lower spec devices?
Note: we use Unity 5.3.6f1. I saw no specific issue mentioned in the 5.3.x later release/patch release, but will try them anyway. In the mean time, any help appreciated.