Search Issue Tracker
Won't Fix
Votes
0
Found in
2017.4.0f1
2018.3.0a1
2018.3.5f1
2019.1.0a1
2019.2.0a1
Issue ID
1131637
Regression
No
List.Sort causes more memory allocation with .NET 4.x than .NET 3.5
How to reproduce:
1. Open the project attached.
2. Open the "SampleScene" scene
3. Make sure that Scripting Runtime Version is .NET 4.x
4. Open the Profiler and enable Deep Profile
5. Enter the Play Mode
6. Examine GC Alloc column in the Profiler.
Expected result: .NET 4.x and .NET 3.5 allocates the same amount of memory
Actual result: .Net 4.x allocates more memory than .NET 3.5
Reproducible with: 2017.4.23f1, 2018.3.8f1, 2019.1.0b7, 2019.2.0a8
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
- NullReferenceException when setting 'isTextObjectScaleStatic' to false on a disabled TextMeshPro GameObject
- Shader Stripping Custom Options disappear when exiting Play mode without reloading Domain
- Decals do not get projected when 'Rendering Layer Mask' on a GameObject is 23rd Layer or above due to encoding/decoding issues
- Deriving from SearchContextAttribute doesn't always work
- Scripting API documentation is missing for macOS editor extensions
Resolution Note:
The .NET 4.x class libraries are using the latest .NET Core code for this functionality. The allocation can be avoided by using the Sort overload taking a System.Comparison<T> parameter.
In general we do not ensure particular performance or allocation patterns in .NET APIs.