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
- Rendering artefacts appear in the Editor when modifying the Reflection Probe box size
- [HDRP] XR Multipass calls BeginCameraRendering and EndCameraRendering for each pass of the same camera
- NavMesh Surface is baked too high above the ground, making the NavMesh Agents hover above the ground when the HeightMesh is not built
- [Android] Crash on ProcessDynamicBatchGeometryJob with OpenGL or on DrawSharedGeometryJobs with Vulkan
- VFX Graph Memory leak when calling the ClearPropertyBinders and AddRemoveVFXProperty
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.