sdabet
sdabet

Reputation: 18670

CCSpriteFrameCache release strategy

As far as I understand the CCSpriteFrameCache gets filled when creating sprites from files and spritesheets and should be clever enough to purge unused frames when getting out of memory.

My question is: in my app should I worry about manually releasing unused frames as soon as possible or should I just rely on the cache to purge itself when necessary?

Is there any side-effect (like overall performance issue of the system or of other running apps) in letting the cache grow until getting memory warning?

Upvotes: 0

Views: 449

Answers (1)

YvesLeBorg
YvesLeBorg

Reputation: 9079

The answer to that truly depends on your app, and its memory footprint. In one of my games, I aggressively purge memory, and load 'just in time', when the game is in a circumstance where the reload will not add undue lags that could be a turn-off for the user.

But as I said, your strategy should be based on actual measurements of the memory footprint, and its 'perceived' impact on user experience. As always, start your measurements on the simulator (OK for measuring memory but NOTOK for measuring time and FPS), but quickly validate with some measurements on real devices.

Upvotes: 2

Related Questions