Out-of-memory Crash on Startup - All Android devices?

We’ve just today updated our Alpha of a released game to 4.11 (release version) and have started sending out invitations.

However, almost every device other than the ones we’ve tested on gives us an out-of-memory error. I have attached logs, and one of the users has a higher spec phone than the ones we’re testing on!

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Stormtide.SatelliteCommand/com.Stormtide.SatelliteCommand.DownloaderActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442)
	at android.app.ActivityThread.access$800(ActivityThread.java:156)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1351)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:211)
	at android.app.ActivityThread.main(ActivityThread.java:5373)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
	at android.view.LayoutInflater.createView(LayoutInflater.java:633)
	at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
	at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
	at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:382)
	at android.app.Activity.setContentView(Activity.java:2145)
	at com.Stormtide.SatelliteCommand.DownloaderActivity.g(Unknown Source)
	at com.Stormtide.SatelliteCommand.DownloaderActivity.onCreate(Unknown Source)
	at android.app.Activity.performCreate(Activity.java:5990)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332)
	... 10 more
Caused by: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Constructor.newInstance(Native Method)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
	at android.view.LayoutInflater.createView(LayoutInflater.java:607)
	... 23 more
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 74649612 byte allocation with 16777120 free bytes and 38MB until OOM
	at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
	at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
	at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)
	at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
	at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1004)
	at android.content.res.Resources.loadDrawableForCookie(Resources.java:2694)
	at android.content.res.Resources.loadDrawable(Resources.java:2576)
	at android.content.res.TypedArray.getDrawable(TypedArray.java:749)
	at android.view.View.<init>(View.java:3813)
	at android.view.ViewGroup.<init>(ViewGroup.java:498)
	at android.widget.RelativeLayout.<init>(RelativeLayout.java:249)
	at android.widget.RelativeLayout.<init>(RelativeLayout.java:245)
	at android.widget.RelativeLayout.<init>(RelativeLayout.java:241)
	... 26 more

I can send an alpha invite to any Epic employee who wants to download and see the issue for themselves, it’s a shipping build, though.

TheJamsh,

Could you please provide additional details, such as which version of Android you’re seeing this issue occur on? What type of devices? Also, go ahead and send an invite too. Let me know what you need in order to send the invite as well.

Thanks!

Hey Samantha,

Just follow this link and request access and you should be able to download soon after! Redirecting to Google Groups

The phone in question was on Android 5.1.1, and was an Xperia Z3. So far we seem to have fixed the issue on a handful of devices by changing the size of the startup / splash images, but that’s all we’ve managed so far.

Thanks for access to your game. This is still under investigation. Are there any other device models that are causing trouble?

I have tested your game out on a few devices:

  • Nvidia Shield - Works perfectly fine
  • Nexus 5 - Works perfectly fine
  • Xperia Z2 - Works perfectly fine
  • LG G2 - Was not compatible

We currently do not have a Sony Xperia Z3 to test on. However, all devices had the same Adreno 330 GPU and Krait 400 CPU as the Xperia Z3 except for the Nvidia Shield which has the Tegra K1 GPU and the Cortex-A15 CPU.

It may come down to the device itself having complications, or one of the drivers. If there is anyway to obtain the logs from the device, that would be really helpful.

This is how we gather logs from devices when trying to figure out what is occurring with the project:

  • Attach your phone to the computer
  • Go here: C:\NVPACK\android-sdk-windows\tools
  • Open up Monitor.bat
  • Launch the program and save the logs

Make sure that you highlight all of the logs, because they do not save unless they’re highlighted.

Thank you!

Hey The Jamsh,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you!

Hey Samantha, thanks for testing.

So what we’ve found is that the crash seems to occur if the phone is running too many apps and the game can’t allocate enough memory. Instead of any kind of OS-level warning, it looks as though Android just hard-crashes the app instead.

I wonder if there’s a feature request we could generate from this which would be to better handle the cases where enough memory can’t be allocated?

Can you provide me with the full Monitor.bat logs from your device when the game crashes out due to not having enough memory? I have yet to get that to happen.

Thanks!