Jump to content

Out of memory crash on Focus Plus build in Unity


OCH

Recommended Posts

Hi,

Our devs are currently facing a memory leak issue with Vive Focus Plus : every app we build crashes after ~30 seconds.  We're using Unity 2019.3.14 with wave SDK 3.1.4. Android logcat shows OpenGL out of memory errors. We've also built the same unity projects for the oculus quest without any issues.

This issue seems to be the same the one described in this post :

Logs :

2020/06/12 11:37:53.382 3191 3265 Error Adreno-GSL <gsl_memory_alloc_pure:2236>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
2020/06/12 11:37:53.382 3191 3265 Error Unity OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_OPERATION: Operation illegal in current state 
2020/06/12 11:37:53.382 3191 3265 Error Unity (Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 353)
2020/06/12 11:37:53.675 3191 3265 Fatal libc /usr/local/google/buildbot/src/android/ndk-release-r16/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating with uncaught exception of type std::bad_alloc: std::bad_alloc" failed
2020/06/12 11:37:53.678 3191 3265 Error Unity Could not allocate memory: System out of memory!
2020/06/12 11:37:53.678 3191 3265 Error Unity Trying to allocate: 80B with 16 alignment. MemoryLabel: NewDelete
2020/06/12 11:37:53.678 3191 3265 Error Unity Allocation happened at: Line:0 in Overloaded New
2020/06/12 11:37:53.678 3191 3265 Error Unity Memory overview
2020/06/12 11:37:53.678 3191 3265 Error Unity 
2020/06/12 11:37:53.678 3191 3265 Error Unity [ ALLOC_TEMP_THREAD ] used: 32832B | peak: 0B | reserved: 3276800B 
2020/06/12 11:37:53.678 3191 3265 Error Unity [ ALLOC_TEMP_JOB_1_FRAME ] used: 0B | peak: 0B | reserved: 3145728B 
2020/06/12 11:37:53.678 3191 3265 Error Unity [ ALLOC_TEMP_JOB_2_FRAMES ] used: 0B | peak: 0B | reserved: 1048576B 
2020/06/12 11:37:53.678 3191 3265 Error Unity [ ALLOC_TEMP_JOB_4_FRAMES ] used: 1018576B | peak: 0B | reserved: 3145728B 
2020/06/12 11:37:53.678 3191 3265 Error Unity [ ALLOC_TEMP_JOB_ASYNC ] used: 29100028B | peak: 0B | reserved: 42991616B 
2020/06/12 11:37:53.678 3191 3265 Error Unity [ ALLOC_DEFAULT ] used: 54352212B | peak: 67146633B | reserved: 56664284B 
2020/06/12 11:37:53.678 3191 3265 Error Unity [ ALLOC_GAMEOBJECT ] used: 840053B | peak: 840381B | reserved: 845240B 
2020/06/12 11:37:53.678 3191 3265 Error Unity [ ALLOC_GFX ] used: 2183872B | peak: 2960416B | reserved: 2186988B 
2020/06/12 11:37:53.678 3191 3265 Error Unity  
2020/06/12 11:37:53.678 3191 3265 Error Unity (Filename:  Line: 1449)
2020/06/12 11:37:53.678 3191 3265 Error Unity 

We don't really know where to look. Any advice would be much appreciated. Should we upgrade Wave sdk ? upgrade Unity version ? is some kind of render setting responsible for this ?

@Cotta

Link to comment
Share on other sites

Have you tried using the profiler in unity to see where the memory is allocated? You don't have much memory to work with on the focus so it can be tricky. In scripts you can also use debug log System.GC.GetTotalMemory() to get a rough idea of the amount of managed memory currently being used.

Link to comment
Share on other sites

Hi RobbyXR,

The profiler in Unity does not show anything suspicious, and the crash never happens in editor.

We often clear the cache of our Focus Plus devices to ensure RAM is not overloaded.

Link to comment
Share on other sites

@OCH We are looking into this issue. It appears to affect all versions of Unity after 2019.2, possibly due to the major changes in Unity XR. If possible use 2019.2 or 2018.4 LTS. When profiling you will notice a memory leak where the VRAM increases in size by about ~100MB /second until it crashes at 1GB VRAM usage.

Link to comment
Share on other sites

Is there a bug report or something where we can track progress of this issue? Affecting our team as well.

 

Also it might be worth indicating this support issue on the Unity SDK downloads, currently the only requirement/note is:
Unity LTS release 2017.4.16f1 or newer is recommended.

Edited by sdfalter
Link to comment
Share on other sites

@sdfalter @OCH This issue has been identified and solutions are being investigated. There are reports of Unity 2019.3.6 working without the memory leak if downgrading to that version is an available option for your project. Currently Unity 2018.4 LTS + SDK3.1.94 are recommended for best performance and stability.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...