- Home /
System Out Of Memory Texture2D
I have added some frame animations using prefabs. I instantiate them in runtime. After adding these prefabs. I have the above error when I build it to apk. If I dont build that scene, it's fine. There are totally around 150 730x730 png inside these prefabs. Of course I already have tons of other textures in other scenes. I need to add even more.
I'm running Unity 4.1.2 on Windows 7 with 4GB ram. How to solve this? Thanks.
I noticed my colleagues changed those textures format from Compressed to True Color. And I changed them back and it works. What's the cause behind this?
Answer by liszto · Jun 05, 2013 at 11:45 AM
First of all, your windows is a 64bit version ? If you are using a 32bit version don't search in other way the problem is just here in front of your eyes.
If you are using a windows 64bit, there is other thing that can provoke this :
Because when you have an image with those dimensions (730*730) with png you have an alpha channel used whereas with a jpg it's only 3. If you have 4 channels in used, with a true color texture, your datas are uncompressed so your picture take more space in memory. With 150 sprites and 730*730px you must reach something like 500Mo (only for this animation) + your others textures. Add to this size the Unity process, and I can supposed your Unity proccess used 600Mo roughly. So only with those 2 parameters I already used 1.2Go and if you have windows with 32bit it won't work. I don't compute the size with all your others textures but I must be higher than this I think.
If it's to build and apk (so an Android game), I can say already one thing it's really too much. Try to decrease your texture size. You really need to have this size ?
Thanks for explanation. I'm using 32bit version. Because my colleague (he's an artist) feels that the images are not perfect so he used True Color. I guess we have to stay with Compressed.
Your answer
Follow this Question
Related Questions
Texture2D Generation Causing Memory Leak (System Out of Memory) 1 Answer
Unity says: "The System is Running out of memory." when it is not. 5 Answers
Crash on Inspector during play 0 Answers
Unity3D 4.6.2 Build Crash Out Of Memory 1 Answer
How to solve the OutOfMemoryException when a List is too big? 1 Answer