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
- DownloadHandlerScript.CompleteContent is called twice when building for WebGL
- Scene view has Y coordinates of the Screen Position node flipped when some of the URP features are disabled
- Volumetric fog shader variants are missing from build when "Strict Shader Variant Matching" is disabled
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
- Files in the target folder are deleted without a proper warning when building an iOS project
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.