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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
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.