Search Issue Tracker
Feature Request
Feature Request in 2022.2.X
Votes
2
Found in
2022.2.0a16
Issue ID
UUM-1500
Regression
No
Incremental Garbage Collection not working properly on HoloLens 2 (and possibly other XR platforms)
Incremental Garbage Collection is not working properly on the HoloLens 2. I built a customer project with Vsync enabled and Application.targetFrameRate = 60 and I expected to see GarbageCollector.CollectIncremental run within the 16.6ms frame budget (assuming the rest of the CPU work is done in time). What actually happens is that CollectIncremental runs for 0ms per frame (despite the application allocating a fair amount of garbage every frame) and then spikes periodically. For example, the attached screenshot "IncGSStillWeird.PNG" shows a frame where all the other CPU work finished at about 14.6ms, but instead of running GC for 2ms, it runs for 6.27ms.
There's a GC.Collect in the middle, but that doesn't start until after the GC has already blown through the frame budget.
My understanding is that the incremental GC is supposed to run at the end of each frame, which on most platforms is when WaitForTargetFPS runs. But on HoloLens 2 the Vsync marker seems to be called XR.WaitForGPU, and instead of happening at the end of the frame, it happens in between the script updates and the main thread rendering work (see attached file "WaitForGPU.PNG" for a screenshot of this on a different frame from the same capture). This means that by the time we get to the end of the frame, there's no CPU time left to allocate for incremental GC - so it either does nothing, or when it really needs to clean up it runs a full stop-the-world GC.Collect.
Comments (1)
-
BuffChocobo
Jun 14, 2022 00:54
I'm having the same issue in 2020.3.31.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Animator state transition preview clips are flickering when zooming in
- [Tile Palette] Sprites not rendering when brush tool "Paint a filled box with active brush" is used for the first time
- Adding available Nodes with longer names in Fragment Context window overflow Fragment Context window in Shader Graph
- "Layer Palette Profile" Asset is automatically applied to the second Terrain but doesn't load any layers
- "Terrain Tools" shortcut conflicts with the Overlays shortcut by default
Resolution Note:
This issue has been converted to a Feature Request. This fix requires planning and extensive testing, and cannot be addressed by a bug fix.
Resolution Note (2022.2.X):
This issue has been converted to a Feature Request. This fix requires planning and extensive testing, and cannot be addressed by a bug fix.