Unexplainable memory overhead while loading textures

Hi all,

We are profiling memory usage on our upcoming game.

Here’s one problem that we encountered that we can’t wrap our head around:

First test:

  • Profile memory usage on our game in current state. When loading, the peak memory usage recorded is 24.6MB. After loading is done and the game enters a level, memory usage goes down to 13.9MB

Second test:

  • Profile memory usage on our game in current state, with 4 additional 1024 * 512 PVRT 4bit textures. When loading, the peak memory usage recorded is 31.26MB. After loading is done and the game enters a level, memory usage goes down to 14.3MB.

From these two tests, it seems that the addition of 4 textures added about 6MB overhead to memory usage.

This causes the game to exceed 30MB peak memory usage, and in turn makes the game pretty unstable with high chance of crashing while loading.

  1. Can anyone help shed some light on the extra memory overhead?

  2. Are there any workarounds for this?

Thank you!

has the non-square thing changed? your 1024 x 512s might be getting padded up to 1024 x 1024. combine two 1024 x 512s into one 1024 x 1024 and you’ll use half as many textures.

follow up:

Thanks for the tip pete. It seems that square texture does reduce peak memory overhead.

We tried the second test again, this time upping the 1024x512 textures to 1024x1024, making the textures square, and as a result the peak memory usage was reduced to around 24MB.

We are guessing that if the texture size does not fit the hardware requirements(1024x512, non square in our case), the device will have to allocate another 1024x1024 in memory and copy it over.