Search Issue Tracker
Fixed in 2022.1.X
Votes
1
Found in
2018.4
2020.2
2020.2.0b5
Issue ID
1282612
Regression
No
Unused prefab data not being cleaned when removing script through override
Reproduction steps:
1. Create new project and import Script2
2. Create an empty Gameobject and add the Script2 component
3. Make the Script2's array be 10,000 in length
4. Turn the Gameobject into a prefab
5. Press randomize on the prefab instance in the scene (creating 10,000 prefab overrides) and save the scene
6. Open the prefab, then delete the Script2 component
7. Save and exit the prefab editor
8. Observe the performance of the original prefab by moving and undoing
Expected result: Unused data gets cleared
Actual result: Prefab retains unused, unreachable data slowing down performance
Reproducible with: 2018.4.28f1, 2019.4.11f1, 2020.1.8f1, 2020.2.0b6
Notes: Seems to also be caused by:
- Commenting/removing the array in the script.
- Changing the array length in the prefab
- Changing the array length in the instance
- Removing the script in the instance (creating a removal override)
Array size should be increased if prefab performance difference is not noticeable
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
- Crash on ResizeScriptingList<ScriptingObjectPtr> when passing an undeclared variable to the results parameter for GameObject.FindGameObjectsWithTag
- [Android] "Screen.safeArea.y" always returns values outside of the Safe Area when the device is in Portrait orientation
- Frame spike due to many TreeRenderer.TreeUpdated calls when repositioning terrains in large Scenes
- Crash on GameObject::RemoveComponentFromGameObjectInternal when reparenting Text GameObjects
- [IL2CPP-GarbageCollector] Changing GCMode might permanently disable GC in a multithreaded context
Resolution Note (fix version 2022.1):
Fixed in 2022.1.0a16