[4.8] Out of memory error when launching on Android

I’m getting failures launching an application on Android due to an “Out of memory” error.
This is probably linked to this previous issue:

but since the issue is supposed to be fixed in 4.8, I reopen it here for better tracking.

The exception may happen on different resources, but is always similar to the following. What do these error mean? no disk space on the the device? No memory on the device? No memory on the mac?

LogPlayLevel: Program.Main: ERROR: AutomationTool terminated with exception:
LogPlayLevel: Program.Main: ERROR: Exception in System: ApplicationName='/Developer/Android/sdk/platform-tools/adb', CommandLine='-s c803cce3 push "/Users/xxx/Documents/Unreal Projects/xxx/Saved/StagedBuilds/Android_ASTC/xxx/Content/Movies/VideoAlpha_Mat.uasset" "/storage/emulated/legacy/UE4Game/xxx/xxx/Content/Movies/VideoAlpha_Mat.uasset"', CurrentDirectory='', Native error= Out of memory
LogPlayLevel: Stacktrace:   at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0
LogPlayLevel:   at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0
LogPlayLevel:   at System.Diagnostics.Process.Start () [0x00000] in <filename unknown>:0
LogPlayLevel:   at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
LogPlayLevel:   at AutomationTool.CommandUtils.Run (System.String App, System.String CommandLine, System.String Input, ERunOptions Options, System.Collections.Generic.Dictionary`2 Env) [0x00000] in <filename unknown>:0
LogPlayLevel:   at AndroidPlatform.RunAdbCommand (AutomationTool.ProjectParams Params, System.String Args, System.String Input, ERunOptions Options) [0x00000] in <filename unknown>:0
LogPlayLevel:   at AndroidPlatform.Deploy (AutomationTool.ProjectParams Params, DeploymentContext SC) [0x00000] in <filename unknown>:0
LogPlayLevel:   at Project.Deploy (AutomationTool.ProjectParams Params) [0x00000] in <filename unknown>:0
LogPlayLevel:   at BuildCookRun.DoBuildCookRun (AutomationTool.ProjectParams Params) [0x00000] in <filename unknown>:0
LogPlayLevel:   at BuildCookRun.ExecuteBuild () [0x00000] in <filename unknown>:0
LogPlayLevel:   at BuildCommand.Execute () [0x00000] in <filename unknown>:0
LogPlayLevel: Program.Main: ERROR: ApplicationName='/Developer/Android/sdk/platform-tools/adb', CommandLine='-s c803cce3 push "/Users/xxx/Documents/Unreal Projects/xxx/Saved/StagedBuilds/Android_ASTC/xxx/Content/Movies/VideoAlpha_Mat.uasset" "/storage/emulated/legacy/UE4Game/xxx/xxx/Content/Movies/VideoAlpha_Mat.uasset"', CurrentDirectory='', Native error= Out of memory
LogPlayLevel: Program.Main: AutomationTool exiting with ExitCode=1
LogPlayLevel: Domain_ProcessExit
LogPlayLevel: CreateProcess: error creating process handle
LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 23.491587
LogPlayLevel: RunUAT ERROR: AutomationTool was unable to run successfully.
PackagingResults:Error: Error Launch failed! Unknown Error

Apparently, packaging the same project works. After installing from package also launching directly works, then at a certain point it breaks again. Ideas?

This is adb push erroring out… I’m not sure what could cause that to run out of memory, I’ve never seen that actually happen. It’s possible that means the device is full. Is it? Is this a real device or are you trying to use a virtual device somehow?

Josh

Hi, it is not a virtual device, it’s a samsung galaxy note 4.
The device is not full, there are more than 4 GB free after installing the app on the memory card and many more on the internal memory.

Once I get this error launching the app, I get it every next time I try to launch it, always on the same file.
If I pack the app and install the apk it works fine, plus if then I try again to launch the app it works again.

Please let me know if I can help with more details, I’m experiencing this problem very often with 4.8.

My only suggestion is try running adb push manually and see what happens:

/Developer/Android/sdk/platform-tools/adb -s c803cce3 push "/Users/xxx/Documents/Unreal Projects/xxx/Saved/StagedBuilds/Android_ASTC/xxx/Content/Movies/VideoAlpha_Mat.uasset" "/storage/emulated/legacy/UE4Game/xxx/xxx/Content/Movies/VideoAlpha_Mat.uasset"

Josh

Running the adb command from the terminal works fine, but if I retry launching it fails in the same way.
Building the apk and installing it fixes the problem for a while (launching after that works again for some time), but the problem is annoying nevertheless.

Hi devel.bmad,

I see the exception is occurring in relation to your movie asset, could it be that the asset is too large? [Here is a recent thread where a was seeing a too large texture and was seeing memory errors][1].

In desperate need of help - IOS app crash on launch - Mobile - Epic Developer Community Forums

The error above was in relation to a material asset (that in turn was using a video as a texture), so the asset itself was fairly small. In any case, the behaviour was quite inconsistent, as I wrote above after installing the packaged version the same asset did install without any problem even launching.
By the way, the specific asset rising this issue is totally random, but once I get this error, I always on the same object until I install a packaged apk.

So, in 4.9 we are most likely going to be upgrading to AndroidWorks, the new suite of tools from NVIDIA, which will install 64-bit tools. That may help this issue.

Otherwise, I’m pretty well out of ideas :expressionless: I’m not sure what could be causing you to see this.

Only other thing I could suggest is to have another machine try it out. Are you seeing this on other machines at all?

Haven’t tried on other machines, but I wasn’t experiencing this issue before 4.8

Hey Devel.bmad,

Would you mind testing this out on another machine to see if you encounter the same issue? If not, you can always package your project and provide it to us in a downloadable link either through a private message on the forums or here on AnswerHub. If you wish for the project to stay between you and Epic, I’d suggest providing the project through a private message on the forums. You can locate me easily by looking for ’ '.

Thank you!

Hi , I may have some problems finding another suitable machine at the moment. What should I provide you, the source project or the packaged apk?
Also, I’m going to checkout 4.9 soon, I’ll let you know if I can reproduce the problem.

Hey Devel,

If you’re only running into this issue when you package it and push it to your Android device then simply provide me the packaged version. If it’s when you launch or package, feel free to zip your whole project (so there won’t be any errors) and provide that to me in a link through a private message on the forums and I can test it out on my end and see if it’s on your end or the project.

Let me know how 4.9.0 Preview 1 treats you!

Thanks!