Back to main page

Memory guide

This guide will tell you what kind of memory is fully reused and what you should avoid creating and destroying too much

Resource collections:

Textures and shaders are static and can therefor be loaded by name from many places without having duplicated memory. The cost is that you can not load these files with the same name from different folders.

Average memory consumption:

Low fixed size to be fully recycled after a while:

Cameras take almost nothing.

Light sources take almost nothing.

Instances take almost nothing.

Bone frames have the maximum number of allowed bones in a fixed size allocation to allow recycling all the memory.

Recycled aligned memory allocations

Collections in the bullet physics engine have it's own memory recycling.

Medium variable size because it is only allocated in loading time:

Shaders take a bit of space but you don't have to worry about it.

High dynamic size using padding to reduce the number of reallocations:

Models need a lot of space for vertex data.

Extreme variable size:

Texture

Draw surfaces take more memory than textures because they use 128 bit color and have multiple buffers.

CPU surfaces have memory for both CPU and GPU for fast communication.

Sound buffers waste a lot of space because they are raw sounds and hardware instancing of sound buffers was obsoleted many years ago.