Performance issues. Total RAM 150 Mb!!!
Based on this thread, I followed MynameisAce solution to reduce loading times
The problem is that my project is using 125 images - 7.2 Mb but when I run the project in GS Viewer the total RAM is starting from 140 MB and goes to 150 MB (sometimes the viewer crashes)
Is this a bug or should I forget about this method of lowering loading times and build actors for each image?
Thank you
The problem is that my project is using 125 images - 7.2 Mb but when I run the project in GS Viewer the total RAM is starting from 140 MB and goes to 150 MB (sometimes the viewer crashes)
Is this a bug or should I forget about this method of lowering loading times and build actors for each image?
Thank you
Comments
http://gamesalad.com/forums/topic.php?id=26244
As a rough guide, each pixel in an image uses 3 bytes of RAM - one for each color.
To see how much RAM an image will use, simply multiply the total pixels by 3.
For example: 480 x 320 x 3 = 460800
So a 480x320 image uses about 460Kb - regardless of the file size.
Older devices will crash when the RAM usage reaches around 40MB. Newer devices have higher limits, but unless you are targeting the newer devices exclusively, it's a safe rule of thumb to stay under 40MB.
GameSalad flushes the RAM when you change Scenes. So you basically can have up to 40MB worth of images and sounds in each Scene. Actors with complicated Rules add to this total too. Any image or sound that you spawn into the Scene adds to the overall total as well.
You need to carefully architect each Scene so it does not go over this limit or risk crashing the device.
The iPhone4 and 4th gen ipod Touches have higher limits and can handle retina display sized graphics, as do both generations of the iPad. However, even on those devices 140MB is dangerously high.
@firemaplegames thank you very much for the tips, I'm currently modifying some images to see what the changes are. It was very strange because with this memory used the frame rate was between 58-60.
I was testing on an iPhone 4 and crashed at 150 Mb
This is why I'm trying to explain this. As I'm seeing a lot of people complain about large memory consumption or images that don't line up right. So I'm just trying to explain so people can create more efficient games.
The memory "containers" do not need to be square. That is an older limitation of graphics cards from the good old days. iOS can handle rectangles. But they are in powers of 2.
A 1012x60 pixel graphic will fit into a 1024x64 memory location.
But you are correct that a 480x320 will fit into a 512x512 memory container. And use that much more RAM.
I had a problem with an animation which was consuming a lot!!!
Thank you guys!
Also, being that GameSalad is a Intel app, Mac users are using the latest cards and a image of 32x128 is fine. As both numbers are power of 2. This isn't so true for Window users though. As some users may have older cards and they will not except anything but power of 2 square images. Which may or may not be a concern for HTML5 games. I haven't research enough on HTML5 yet myself.
Anyway, I was just trying to help and I hope no one took my post as a fuss.