Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

GvrControllerInput.Update() allocates 30 bytes on the heap every frame #835

Closed
Claytonious opened this issue Jan 17, 2018 · 7 comments
Closed

Comments

@Claytonious
Copy link

GvrControllerInput.Update() allocates 30 bytes on the heap every frame of gameplay. This eventually leads to the GC needing to run. Generally speaking, nothing should allocate on the heap every frame of gameplay.

Found using:
Gvr sdk 1.120.0
Unity 2017.3.p2
Google Pixel XL

To repro:
Build any game that uses GvrController prefab with default arm model, etc., connect to Unity profiler, and observe heap allocations.

At first glance, it's not obvious what is allocating in here and I haven't been able to deep profile it yet to find out.

@rusmaxham rusmaxham added the bug label Mar 28, 2018
@ddrocco
Copy link

ddrocco commented Mar 29, 2018

Thanks for your report; we'll take a look.

@chaosemer chaosemer added Unity bug and removed bug labels Apr 16, 2018
@ddrocco
Copy link

ddrocco commented Apr 16, 2018

I've traced the allocation to the UnityEngine.XR.XRSettings.loadedDeviceName (UnityEngine.VR.VRSettings.loadedDeviceName pre-2017.2) method, which allocates the memory for a new string. Unfortunately, I don't see a clean workaround from our end. We've marked this as a Unity bug.

@rusmaxham
Copy link
Contributor

We've partially fixed this in the latest release.

@ddrocco
Copy link

ddrocco commented Aug 25, 2018

This has been fixed in our upcoming GVR release. The fix will be compatible with 2018.3 Unity and later (and will have no effect on earlier versions).

@Adam-VisualVocal
Copy link

Any chance you could push this fix into the Unity Long Term Support stream? Thanks.
https://unity3d.com/unity/qa/lts-releases

@rusmaxham
Copy link
Contributor

This required an API change, and as such, is not likely to get a back port to 2017.4.

@rusmaxham
Copy link
Contributor

Now released.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

5 participants