8 Easy Tricks to Drastically Shrink Your Memory Consumption
Daniel Sperl on July 16, 2014When people start to develop for mobile, they usually have one top requirement: performance. That’s why Starling does everything in its power to make your game run as smooth as possible. I’ve also talked and written frequently about the practices to follow for best results in this area (this wiki article is probably known by most Starling developers).
However, when people move on in the development of their games, they will inevitably run into an equally important issue: memory usage.
Modern mobile hardware often boasts with ridiculously high resolutions, and this requires 2D games to use equally high resolution textures. At the same time, those devices are notoriously ill-equipped with RAM. That’s a truly vicious combination!
Using more RAM than what’s available will make your game crash sooner or later. If you’re lucky, you’ll at least get one of the famous #3691
-errors (“Resource limit for this resource type exceeded”) just before that happens. At least you know what hit you!
Dispose your Waste!
To help you with this, I just added a new chapter to the Starling Manual in the Wiki: Memory Optimization.
This article will show you how to get the upper hand in this struggle! You just have to follow some simple guidelines:
- Dispose your Waste
- Do not Embed Textures
- Use RectangleTextures
- Use ATF Textures
- Use 16 bit Textures
- Use Bitmap Fonts
- Optimize your Texture Atlas
- Use Adobe Scout
This is a topic that comes up frequently in the Starling community. After all, there are some traps that are really easy to fall into! I hope this post helps you to avoid those. Be sure to check it out!
Starling Wiki: Memory Optimization