Cadrick Loh
Cadrick Loh

Reputation: 721

Memory allocation keep on increasing during Memory Allocation Profiling

I have profiled my game in allocation mode and I found that the total amount of allocation is keep on increasing everytime I'm doing something... why is it happens ?!

But when I do profiling on memory leaks, it's running fine, I mean I didn't cause any leaks in my game.

So can anyone tell me how should I look at the allocation profiling?

Upvotes: 1

Views: 1627

Answers (2)

Haroon
Haroon

Reputation: 695

According to me you can use

[[CCTextureCache sharedTextureCache] removeUnusedTextures];
[[CCSpriteFrameCache sharedSpriteFrameCache] removeUnusedSpriteFrames];

in your code in onExit method,this will remove the unused textures and frame in the cache.

unschedule all the selector when replacing the scene.

Upvotes: 1

ArjunShankar
ArjunShankar

Reputation: 23680

According to this answer: Checking memory allocation in Instruments

the allocation will always go up. i.e. deallocations are not taken into account.

This year old blog post explains in general how to use the Allocation Instrument, and the others too: http://gigaom.com/apple/apples-instruments-for-developers/

Upvotes: 4

Related Questions