Suddenly this weekend, a scene that used to run fine in Play mode will now, when it is loaded from another scene or directly entered by pressing play:
- Load for a suspiciously long time
- Eat up all my computer’s RAM (16GB + 12GB GPU I think?)
- Crash my computer in a variety of different ways (due to the aforementioned lack of RAM)
I am using hundreds of 8192 max size textures (4840 x 3160 px) to animate different characters in a visual novel-style game. That’s a me problem. BUT, by using sprite atlases, all the characters could fit into and run in a WebGL build before.
Until this weekend, I could also run this scene in Unity with Clip Studio Paint, Discord, VSCode, Chrome, and other applications open in the background with no memory issues whatsoever. Now, even with just Unity running, this scene will crash my entire computer. Here’s a piece from one of the crash logs:
Could not allocate memory: System out of memory!
Trying to allocate: 61177600B with 16 alignment. MemoryLabel: Texture
Allocation happened at: Line:69 in C:\build\output\unity\unity\Runtime\Utilities\dynamic_array.h
Memory overview
[ ALLOC_TEMP_TLS ] used: 42312B | peak: 0B | reserved: 28606464B
[ ALLOC_MEMORYPROFILER ] used: 1674576B | peak: 1884304B | reserved: 3145728B
[ ALLOC_DEFAULT ] used: 391095964B | peak: 0B | reserved: 572387328B
[ ALLOC_TEMP_JOB_1_FRAME ] used: 0B | peak: 0B | reserved: 2097152B
[ ALLOC_TEMP_JOB_2_FRAMES ] used: 0B | peak: 0B | reserved: 2097152B
[ ALLOC_TEMP_JOB_4_FRAMES (JobTemp) ] used: 0B | peak: 0B | reserved: 62914560B
[ ALLOC_TEMP_JOB_ASYNC (Background) ] used: 329164B | peak: 0B | reserved: 18874368B
[ ALLOC_GFX ] used: 25365523096B | peak: 0B | reserved: 25380798464B
[ ALLOC_CACHEOBJECTS ] used: 89929484B | peak: 0B | reserved: 237682688B
[ ALLOC_TYPETREE ] used: 63804800B | peak: 0B | reserved: 71303168B
[ ALLOC_PROFILER ] used: 496552B | peak: 503016B | reserved: 16777216B
[ ALLOC_PROFILER_EDITOR ] used: 0B | peak: 0B | reserved: 0B
d3d11: failed to create 2D texture id=2881 width=4840 height=3160 mips=1 dxgifmt=28 [D3D error was 8007000e]
d3d11: failed to create 2D texture shader resource view id=2881 [D3D error was 80070057]
d3d11: Failed to create 2D texture in GfxDeviceD3D11
Crash!!!
There is +25GB used in ALLOC_GFX… I don’t know what that means but that number seems too high!
Recently, I added a new system to the game that involved about 300 more images being added (these ones fit into an atlas only ~2.6MB). The session that I added these images, 2026-01-11, everything in the editor ran fine. But when I opened the project again on 2026-01-16, with no changes made to the scene, it now runs out of memory on play every time.
To troubleshoot, I tried:
- Deleting the new system scripts / GameObjects from the scene
- Checking Windows updates → none occurred between the two sessions
- Updating my graphics card (RTX 3060)
- Deleting the project library and reimporting (it’s still almost 80GB…)
- Deleting unused assets from the project
- Uninstalling and reinstalling my Unity editor
- Running the Windows memory diagnostic tool (no issues found)
None of the above worked. Finally, after fiddling with the scene, the only thing that got it to run again was removing nearly all the character animators from the scene. This confuses me, since I haven’t touched the character animators in months.
So. Each character has their own animator / animator controller with unique animation clips + a corresponding sprite atlas for their images. Characters have 15+ layers of UI Images, to create a “sandwich” of the character (head, eyes, mouth, body, etc); they each have 100s of frames, but most of these frames are empty space.
Every frame is imported at the largest size with no compression, and then crunch compressed in the atlas (otherwise, I experienced colour variation flickers).
Each non-main character is a group of UI Images that lives in a shared GameObject (“sprite”) in a Canvas (“_prerender_sprite”) like this:
The main character lives on a different canvas, but follows the same structure. Up to 2 characters can display at a time (the main character + 1 other character), but the non-main characters frequently swap in and out. I also added up all the sizes of the character sprite atlases and got only 54.9 MB (but, maybe this is meaningless if the sprites get decompressed).
I tried to use the profiling tool, first with the main character animator + 1 non-main character animator, and then just the main character animator. If I’m reading the results right, it seems that the difference between having 2 characters vs 1 character in the scene is 1.34GB of textures?
But I have no idea what would be causing that number. The uncompressed images used in the removed animator’s animation clips total to 58.3MB texture * 94 = 5.48GB, which is too large. But those images also pack into 1 page of a sprite atlas and are < 4MB compressed.
My questions therefore are:
- Why did my scene run fine one day, and then the next day was completely broken, when nothing changed?
- And why would it still be broken after removing the newest additions (that DID work at the time they were added)?
- Why did removing Animators make a difference in memory?
- Does that mean an Animator is loading every texture associated with its animation clips into memory at the start of a scene?
- But why would one character be a difference of 1.34GB, when the associated Sprite Atlas is only a few megabytes? Where did this number come from?
- And if the atlases get decompressed in memory to be gigabytes large, why could my computer / WebGL handle 15 different characters before?
- Is there a better way to handle multiple animated characters that can swap out frequently?
- Would instantiating / destroying a prefab every time a character appears / disappears be any better in terms of memory? Worse in terms of performance?
- Could there be something else causing the crashes that I’ve overlooked?
Thank you very much for reading all this yapping, and for any advice / help you can provide ^^











