SKTextureAtlas Loading and Memory Management

Each TextureAtlas is 60K

As a file maybe. But that’s not memory usage. To calculate memory usage of an image file, take the file’s dimensions and multiply them with color bit depth (usually 32 bits = 4 bytes).

For example a 4096×4096 texture uses 16 MB of texture memory (but it may be much less than 1 MB as a PNG file).

4096 x 4096 x (32/8) = 16 Megabytes

Long story short: use Instruments to verify your app’s actual memory consumption.

Leave a Comment