googlevr / gvr-unity-sdk

Google VR SDK for Unity
http://developers.google.com/vr/unity/
Other
2.71k stars 1.09k forks source link

Crash on IOS - GFX DRIVER keeps growing #352

Closed vivalavladislav closed 7 years ago

vivalavladislav commented 8 years ago

Hi guys,

In my project I use GVR 1.0 and started observing crashes after 5-6 minutes of playing. So then I went to unity's profiler and found out that GFXDRIVER is constantly growing and, apparently, that's the reason for "out of memory" crash.

This is easily reproduced when building only basic demo scene and after 5-10 minutes gfxdriver will grow from 3mbs to 120 mbs easily.

One more thing: this is happening only when VR MODE ENABLED.

Unity 5.4.1f, GVR 1.0, OPENGLES2-3(no Metal enabled), iPhones 6s, ios 10.0.1

I hope that you can get here as soon as possible.

Thanks in advance, Vlad

nathanmartz commented 8 years ago

What do you mean by "VR mode enabled"? Are you setting VRSettings.enabled or using one of the components in our Unity plugin? Also, what basic demo scene are you using? Are there any canvases in it? I think there was a bug along those lines.

vivalavladislav commented 7 years ago

I official cardboard package https://developers.google.com/vr/unity/ Demo scene is in Assets/GoogleVR/DemoScenes/HeadsetDemo/DemoScene.unity

VR mode enabled on GvrViewerMain prefab, GVR VIEWER SCRIPT

There's one Unity Canvas

DVTAzoug commented 7 years ago

I'm having the same issue in an iOS/Android project that can be run with or without the cardboard. The iOS cardboard version crashes after a few minutes.

Here's what the XCode profiler looks like: 2016-10-24_17-26-33

Top row is the normal version, bottom row is the cardboard version. They're the same project, and the user can choose which mode to run around 30 seconds in. If the user chooses to use the cardboard mode, we enable VR mode on the GvrViewerMain prefab. It works just fine on Android, but the memory usage steadily increases on iOS, until the app crashes.

My scene has multiple canvases in it. Are there any workarounds I should be aware of?

nathanmartz commented 7 years ago

Please confirm that the issue goes away when you deactivate the canvases and we'll go from there.

DVTAzoug commented 7 years ago

Looks like that worked! Obviously I'm going to need my canvases back though :(

vivalavladislav commented 7 years ago

Same here: disabling canvases fixed memory grows

nathanmartz commented 7 years ago

So, this is a problem with in Unity that was, I think, fixed in 5.4.2. If that doesn't fix it for you, you can change from Unity distortion to Native.

nathanmartz commented 7 years ago

If you remove or disable the canvas does the memory leak go away? I suspect it will.

On Fri, Oct 21, 2016 at 8:15 AM, vivalavladislav notifications@github.com wrote:

I official cardboard package https://developers.google.com/vr/unity/ Demo scene is in Assets/GoogleVR/DemoScenes/HeadsetDemo/DemoScene.unity

VR mode enabled on GvrViewerMain prefab, GVR VIEWER SCRIPT

There's one Unity Canvas

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/googlevr/gvr-unity-sdk/issues/352#issuecomment-255404747, or mute the thread https://github.com/notifications/unsubscribe-auth/ANamfgV348u2J6z0JS4u_CtjMSF1RPB9ks5q2NcQgaJpZM4KdLPO .

vivalavladislav commented 7 years ago

I think I updated unity to the latest release, and that big memory consumption disappeared. However sling memory growth is still present: I think 5megs per minute.

But yea, I have multiple canvas in the scene. When I did switch them off, leaks disappeared

On Tuesday, 25 October 2016, nathanmartz notifications@github.com wrote:

If you remove or disable the canvas does the memory leak go away? I suspect it will.

On Fri, Oct 21, 2016 at 8:15 AM, vivalavladislav <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

I official cardboard package https://developers.google.com/vr/unity/ Demo scene is in Assets/GoogleVR/DemoScenes/HeadsetDemo/DemoScene.unity

VR mode enabled on GvrViewerMain prefab, GVR VIEWER SCRIPT

There's one Unity Canvas

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/googlevr/gvr-unity-sdk/issues/352# issuecomment-255404747, or mute the thread https://github.com/notifications/unsubscribe-auth/ANamfgV348u2J6z0JS4u_ CtjMSF1RPB9ks5q2NcQgaJpZM4KdLPO .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/googlevr/gvr-unity-sdk/issues/352#issuecomment-256119500, or mute the thread https://github.com/notifications/unsubscribe-auth/AI6i5OyhjARPaU0o0H4ydV3S01rQyjA5ks5q3kfRgaJpZM4KdLPO .

nathanmartz commented 7 years ago

Thanks. That makes me pretty confident the bug has nothing to do with GVR but is just highlighted by it.