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
- Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- Crash on dynamixel_sdk.dynamixel:groupSyncReadTxRxPacket when entering Play Mode after updating path to Dynamixel SDK in script
- NullReferenceException is thrown when changing the Inspector preview selection
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.