1
Support / platform sprites still loading into ram
« on: August 22, 2014, 01:56:29 am »
Thanks for all of your help Unikron. Unfortunately have another question for you...
I've been trying to implement platforms on tk2d but my app still crashes cuz of memory pressure at startup on my nemesis, the iphone4s.
My platform setup and @2x and @1x textures work fine in the Unity3d editor. Textures switch great.
However, since the iphone4s is still crashing on me cuz of memory pressure when building in Xcode, I am fairly certain that somehow my larger textures must be getting loaded into RAM at startup-- despite the platform setting.
I suspect this is case because:
A) before implementing platforms, as a test I manually changed all of my tk2d atlas compression to 16bit from 32 and it loaded fine on the iphone4s
B) i then implemented platforms which by my calculations should be much much smaller than simply changing from 32 to 16 (in fact my 2x and 1x textures are ALSO set to 16bits as well as being physically smaller)
C) I'm certain I'm switching the tk2d platform before a single sprite loads. I even went so far as to add a blank scene to the very start of my app that ONLY has: tk2dSystem.CurrentPlatform = "1x";
My debug verifies that I am indeed using the 1x platform at the very start of loading.
However I'm still getting memory crashes on startup.
Could this be because I *started* my sprites with a default size of 4x?
So maybe the default 4x has to load initially before then switching down to 1x?
I'd clarify that while some of my tk2d sprites are being loaded as prefabs, some are just sitting in my scene #2 hierarchy. So I'm assuming maybe those 4x textures load and hit ram somehow before getting a chance to switch to 1x?
Thanks very much for your great support and ongoing help!!
Sebastian
I've been trying to implement platforms on tk2d but my app still crashes cuz of memory pressure at startup on my nemesis, the iphone4s.
My platform setup and @2x and @1x textures work fine in the Unity3d editor. Textures switch great.
However, since the iphone4s is still crashing on me cuz of memory pressure when building in Xcode, I am fairly certain that somehow my larger textures must be getting loaded into RAM at startup-- despite the platform setting.
I suspect this is case because:
A) before implementing platforms, as a test I manually changed all of my tk2d atlas compression to 16bit from 32 and it loaded fine on the iphone4s
B) i then implemented platforms which by my calculations should be much much smaller than simply changing from 32 to 16 (in fact my 2x and 1x textures are ALSO set to 16bits as well as being physically smaller)
C) I'm certain I'm switching the tk2d platform before a single sprite loads. I even went so far as to add a blank scene to the very start of my app that ONLY has: tk2dSystem.CurrentPlatform = "1x";
My debug verifies that I am indeed using the 1x platform at the very start of loading.
However I'm still getting memory crashes on startup.
Could this be because I *started* my sprites with a default size of 4x?
So maybe the default 4x has to load initially before then switching down to 1x?
I'd clarify that while some of my tk2d sprites are being loaded as prefabs, some are just sitting in my scene #2 hierarchy. So I'm assuming maybe those 4x textures load and hit ram somehow before getting a chance to switch to 1x?
Thanks very much for your great support and ongoing help!!
Sebastian