Search Issue Tracker
By Design
Votes
0
Found in
2017.4.0f1
2018.3.0a1
2018.3.6f1
2019.1.0a1
2019.2.0a1
Issue ID
1129495
Regression
No
GC is constantly allocating when using OnPostRender as a Coroutine on a Camera with a TargetTexture assigned
How to reproduce:
1. Open the "SampleScene" Scene in the attached "CleanerRepro1129495.zip" Project
2. Open the CPU Profiler
3. Enter Play Mode
4. Observe the GC.Alloc value
Expected Behavior: The GC allocates 0 in OnPostRender method
Actual Behavior: The GC allocates 40b in OnPostRender method
Reproducible with: 2017.4.23f1, 2018.3.8f1, 2019.1.0b6, 2019.2.0a8
Note: Changing the Method to void or setting the TargetTexture to none removes the issue
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
- The Up, Down and other Buttons in a Style Sheet's Inspector unselect items when they are clicked while they are disabled
- Virtual Player remains active and still launches when removed from Additional Editor Instances from a custom Play Mode Scenario
- UI Toolkit Editor Window Creator becomes not interactable and greyed out when a long name is entered
- [Web][iOS] Web Player keeps restarting on launch when Native C/C++ Multithreading is enabled
- "Add Scene to Scenes in Build" pop-up reappears after Scene has already been added and another Multiplayer Editor Instance is loaded
Resolution Note:
Implementation of iterators in C# compilers is done by generating a state machine class that is instanciated when the iterator is called to maintain the state of the iterators accross MoveNext/Current calls.
This is totally expected that an allocation takes place, and working with the profiler showed me that this allocation is indeed due to the state machine.
See my latest comment for more details