x


iPad real memory accumulation, how to prevent this?

Hi,

Currently running my app under Performance tools Activity checks and looking at the Real Memory entry.

It keeps accumulating as I load levels, Levels have more or less the same amount of textures and code, so why does the real memory accumulates. I don't load additive, I simply load a new level (Application.LoadLevel). The amount of gameObject not destroyed within the entire application is constant.

It seems that when a memory warning is issued, it cleans a bit , but it's never back to the start up value or anywhere close.

Am I missing something really obvious?

I though that Application.LoadLevel() was the best way to manage memory consumptions.

Thanks for your insight,

Bye,

Jean

more ▼

asked Mar 04 '11 at 12:25 PM

Jean Fabre gravatar image

Jean Fabre
3.1k 68 74 103

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Hi,

I found that loadLevel do not release assets properly for the garbage collector to to its work when needed, and in the troubleshooting page, they mentionned loadLevelAdditive as an alternative and it works reliably.

1- load an empty scene using loadLevel() ( a special scene with nothing in it) 2- load your actual scene additively using LoadLevelAdditive() 3- I just call UnloadUnusedAssets just to force things. it might not be required tho.

in effect, this equal loadLevel(), but now, the app is 100% stable and I don't get any memory warnings like when just using loadLevel() only.

Hope it helps,

Jean

more ▼

answered Mar 11 '11 at 03:17 PM

Jean Fabre gravatar image

Jean Fabre
3.1k 68 74 103

Thanks for sharing the answer.

May 09 '11 at 05:50 AM Joshua

This worked for me too. XCode was reporting that it was unloading hundreds of unused objects, but the Objects Now kept increasing with every level. It is still unloading a lot, but the Objects Now is staying where it should be - around 100-300. Memory in use went from constantly increasing up to 5.9MB to a stable 1.5MB per level loaded.

Thanks!

Aug 02 '12 at 06:26 PM Voronoi
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1953
x360
x326
x28

asked: Mar 04 '11 at 12:25 PM

Seen: 4350 times

Last Updated: Aug 02 '12 at 06:26 PM