- Home /
Crash from texture memory?
Hey guys,
I am working on an interactive storybook that is very illustration heavy. Each page is a 2048^2 texture and there are 44 pages. Currently I have an array which contains each page as a prefab which gets instantiated when you turn the page, and the previous page gets destroyed.
Unfortunately, my program will not even start up on the device, and I'm getting no error message from Xcode. After turning through about 25 pages in the editor, Unity itself crashes due to low texture memory.
Is there a better way to handle these massive textures while still retaining nice quality?
@Eric5h5 It didn't worked for me.
I am using below code to get textures in my scene-
BGForest.GetComponent ().sprite = (Sprite)Resources.Load("Texture/$$anonymous$$apScreen/$$anonymous$$apScreenBG/$$anonymous$$ap_image1_forest2",typeof(Sprite));
and using following code to unload unused assets when new scene loads - Resources.UnloadUnusedAssets();
$$anonymous$$y game crashes after running 5-6 $$anonymous$$utes. Scenes slowly become heavy and xcode starts giving memory warnings and at end game crashes.
Any way out?
Hey, i've got similar problem. Did your resolved it?
Answer by Eric5h5 · Dec 31, 2012 at 08:40 PM
Destroying Unity objects won't remove them from memory, since they are not subject to garbage collection. If there are no references to a Unity object, it's cleaned up when loading a new level, or you can use Resources.UnloadUnusedAssets.
@Eric5h5 It didn't worked for me.
I am using below code to get textures in my scene-
BGForest.GetComponent ().sprite = (Sprite)Resources.Load("Texture/$$anonymous$$apScreen/$$anonymous$$apScreenBG/$$anonymous$$ap_image1_forest2",typeof(Sprite));
and using following code to unload unused assets when new scene loads - Resources.UnloadUnusedAssets();
$$anonymous$$y game crashes after running 5-6 $$anonymous$$utes. Scenes slowly become heavy and xcode starts giving memory warnings and at end game crashes.
Any way out?
Your answer
Follow this Question
Related Questions
Loading a Random Resource in a Folder Without Using Resources.LoadAll 0 Answers
Low Memory Crash on iPad1 1 Answer
Lost texture in Android build 0 Answers
Prefab and certain script makes unity crash. 1 Answer
Several Memory Optimization Questions 0 Answers