Search Issue Tracker
Fixed in 2021.1.X
Fixed in 2019.4.X, 2020.1.X, 2020.2.X
Votes
0
Found in
2019.4
2020.1
2020.1.1f1
2020.2
Issue ID
1271254
Regression
No
[IL2CPP] UnsafeUtility methods generate garbage when using IL2CPP Scripting Backend
How to reproduce:
1. Open the attached "1271254 repro" project
2. Open Build Settings and make sure that Development Build and Autoconnect Profiler options are checked
3. Build and Run the project
4. Open the Profiler window from Window > Analysis > Profiler
5. Open the Memory Module of the Profiler window
Expected results: UnsafeUtility doesn't generate garbage regardless of the Scripting Backend
Actual results: UnsafeUtility generates garbage when using IL2CPP
Reproducible with: 2019.3.0f1, 2019.4.8f1, 2020.1.0a1, 2020.1.3f1, 2020.2.0a21
Could not test with: 2018.4.26f1 (certain UnsafeUtility methods aren't available), 2019.3.0b12 and earlier (required versions of Collections package aren't available)
Notes:
-The memory spikes in the profiler are around 36kB in size when using IL2CPP
-Switching Scripting Backend to Mono makes the issue disappear completely without tiniest memory spikes
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
- The Scene View becomes gray and "NullReferenceException" errors are thrown when attaching the Unity Editor process to RenderDoc
- Memory usage rapidly rises when changing colors in the color wheel
- Physically Based Sky's Horizon and Zenith Tint Color Selection Bars don't have immediate access to color pickers
- EmptyAdditionalLightShadowmapTexture leaks from memory when URP quality level is changed using QualitySettings.SetQualityLevel
- Referenced ScriptableObject field does not get updated and cannot be set to "None" when there are no Objects of that type
Resolution Note (fix version 2021.1):
Fixed in 2021.1.0a1
Resolution Note (fix version 2020.2):
Fixed in 2020.2.0b7
Resolution Note (fix version 2020.1):
Fixed in 2020.1.14f1
Resolution Note (fix version 2019.4):
Fixed in 2019.4.15f1