optimization
Memory Explodes on Window Switch
Under Audit
Unity 2022.x - Unity 6.x
Published 3 days ago
Memory usage, particularly texture memory, significantly increases in the Unity editor when switching focus to another application while a game is running.
When a game is running in the Unity editor, switching focus to a different window can cause a significant memory increase. A typical run of a game in the Unity editor might use around 3.17 GB total memory, with 1.05 GB allocated for textures. However, upon switching windows, the texture memory usage continuously grows to an unusually high amount, leading to an explosion in overall memory consumption.
- Verify
Texture Streamingsettings inProject Settings(Qualitytab) and individual texture import settings to manageVRAMeffectively. - Inspect custom
Editorscripts for any logic that might continue to allocate memory or process resources when theEditorwindow is not in focus. - Temporarily disable any custom
Editorwindow drawing or continuousGameObjectupdates that occur when theEditoris in the background, to isolate the issue.
Editor's Note:
Related Posts Haven't quite found a solution to your problem? We think these posts might help you.
[Editor] Fix ALLOC_TEMP_TLS Memory Leaks and Slow Play Mode[Pro Builder] Eliminate Drag Select Shader Recompile Lag[Prefab] Runtime Overhead of Removed Components in Variants
Content inspired by a Unity discussion post.