Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.39f1
2022.3.31f1
6000.0.4f1
Issue ID
UUM-72857
Regression
No
Freeze when spawning a Prefab while in Play Mode
Reproduction steps:
1. Open the attached “repro_IN-76097“ project
2. Watch the attached video for the pattern that you need to press
3. Observe a freeze
Reproducible with: 2021.3.39f1, 2022.3.31f1, 6000.0.4f1
Reproducible on: Windows 10 (22H2)
Not reproducible on: No other environments tested
Notes:
* Reproducible in Player
* When the freeze occurs, memory leak can be observed, which can cause a “Could not allocate memory: System out of memory!“ error and a crash if the PC doesn’t have a lot of RAM
* Was not able to reproduce the crash (with 64 GB of RAM)
* User was able to reproduce the crash
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
- Search field in UI Builder's Library has no character limit
- Changing the value in UI Builder by dragging increases it by a few thousand points when reaching the borders of the screen
- ARM64 architecture DLL incorrectly copied instead of x64 when building for Windows x64
- Crash on TypeTreeIterator::GetNode when opening a specific folder
- Crash on WriteSerializedAssetsV2 when (re)entering the Play Mode in a specific project when IEnumerator Start() is used
Resolution Note:
The out of memory error is caused by the script of "WinCon.cs" entering a state where "collisionCounterCircle >= requiredCollisions" is true where two objects are instantiated. Unfortunately, "collisionCounterCircles" is never reset so this condition is true forever resulting in the continuous creation of objects until memory runs out. At some point, because physics is dealing with more and more objects it asks for more memory which is refused and triggers an out-of-memory assert.
The error here is in the script logic creating too many objects without limit.
This was quickly found by debugging the project, placing a breakpoint where instantiate happens. In the future I would recommend following the debugging guide so issues lik this can quickly be found:
https://docs.unity3d.com/Manual/ManagedCodeDebugging.html