unexpected massive memory allocation on iOS while loading maps


We’re experiencing strange memory warning (and occasional crashes) on iOS (iPad 1st gen) with our game.

It seems to be related to loading of maps.
After the map is loaded the memory allocation fall to normal values. Only during loading it seems to explode (and shows the memory warnings)

here is a dump of what we see in Xcode memory profiler:
alt text

As you can see there are massive allocations when loading levels (see 1,2,3) that lead to memory warning and crashes.

There is no allocation peak when transitioning from a level to the menu (simple map), as you can see in the picture between 2 and 3.

If I profile the game with Unity profiler (always running on iOS) I get this memory allocation behaviour:
alt text

That shows no memory allocation peak during the map loading.

Does anyone have an idea of what’s going on?
How can we avoid those memory warning (and relative crashes) ?

thanks in advance


Figured out: it were the substance textures allocating a lot of useless memory being released as the map started.

removed all the substance textures and the allocation process proceed the proper way.