Search Issue Tracker
By Design
Votes
0
Found in
2018.1.0f2
Issue ID
1044061
Regression
No
Itterating through a list with foreach always generating GCAlloc
Steps to reproduce:
1. Download and open the attached project
2. Enter Playmode
3. Press "4"(not numpad) to initiate iteration
Expected result: no GCAlloc
Actual result: 63 bytes of GCAlloc on every iteration
Reproduced on 2017.4f1, 2018.1.3f1, 2018.2.0b6, 5.5.6f1*
*this was allegedly fixed in 5.5 - https://unity3d.com/learn/tutorials/topics/performance-optimization/optimizing-garbage-collection-unity-games
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
- Fixing Message Loss in UMPE During Domain Reload
- The Editor freezes when ScheduleReadOnly of IJobParallelForTransform with dependency is used
- Text is truncated in the Inspector when the display scale is set to 150%
- CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player
- VFX property value names are cut off when properties with 'Arc' are viewed in the VFX Blackboard
Resolution Note:
All allocations related to collection iteration (for properly designed collections) have been alleviated by use of newer C# compilers. This allocation reported here is actually an internal Type object allocated by the runtime when the first method of a type being JIT'd. It only happens once and is not specifically related to the collection iteration.