Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
GlimpseGroupDev's avatar
3 years ago

Random spike in CPU usage and longer render times

Hello, I am a developer on a Unity app for Quest 2. We have a performance problem with our app that causes huge spikes in CPU usage.

The app performs well and as we want it to at first, seen here captured by OVR metrics:


All of the systems in the app test well and do not cause problems but after a certain amount of time doing various things, a user has a random random chance of having the framerate plummet. In this next picture, I experienced the bug and then returned to the login screen where the bug persisted:


You can see that CPU usage has skyrocketed to a locked 100%. You would think that there is some process taking up frame time in the background. I took a look at the profiler on a build to see if there was a key culprit. 
Here is a frame under good conditions where performance is as expected:



And after the bug, the frame looks like this:



You can see that the player loop has almost doubled in duration, but the scripts portion of the frame is actually pretty much the same. The change is entirely in EarlyUpdate.XRUpdate and PostLateUpdate.FinishFrameRendering taking 5x as long as before. 


So why am I getting a huge CPU usage spike while also the rendering of the same workload is suddenly taking so much longer?? Is there any chance that the quest is downclocking under stress? Once this happens, there is no way to retrieve the old performance until you restart the app completely. There is no surefire way to trigger this to happen, it just randomly takes place when there's a decent amount going on and then stays forever. I do not understand what APP T and TW T mean in the OVR metrics panel as well, if those might lead to a culprit. Any ideas would be much appreciated, thank you. 

No RepliesBe the first to reply