0

我创建了 cocos2d 游戏。在测试过程中,我收到了一些内存警告,我解决了 ipad3(新 ipad)中的所有内存警告,但我无法解决 ipad 1 中的以下内存警告。你们能帮我....

1.

2012-08-01 22:19:16.399 Game[238:707] cocos2d: CCSpriteFrameCache: Trying to use file 'Animation.png' as texture
2012-08-01 22:19:16.662 Game[238:707] cocos2d: CCSpriteFrameCache: Trying to use file 'Ani.png' as texture
2012-08-01 22:19:16.681 Game[238:707] cocos2d: CCSpriteFrameCache: Trying to use file 'Faces.png' as texture
2012-08-01 22:19:16.753 Game[238:707] cocos2d: removeChildByTag: child not found!
2012-08-01 22:19:16.819 Game[238:707] Received memory warning.

2.

2012-08-01 22:23:11.573 Game[238:707] cocos2d: Received memory warning.
2012-08-01 22:23:11.573 Game[238:707] cocos2d: CCTextureCache: removing unused texture: img.jpg
2012-08-01 22:23:11.576 Game[238:707] cocos2d: CCTextureCache: removing unused texture: play.png
2012-08-01 22:23:11.582 Game[238:707] cocos2d: CCTextureCache: removing unused texture: img1.png
2012-08-01 22:23:11.585 Game[238:707] cocos2d: CCTextureCache: removing unused texture: youNeedToPopup.png
2012-08-01 22:23:11.590 Game[238:707] cocos2d: CCTextureCache: removing unused texture: popup.png
2012-08-01 22:23:11.599 Game[238:707] cocos2d: CCTextureCache: removing unused texture: conti.png

谢谢

4

1 回答 1

0

内存警告是完全正常的。实际上,这是允许 iOS 重新收回已用内存的机制,这些内存可以被释放并继续工作而不会崩溃。

您可以在 Instruments Allocation 工具中观察到:内存逐渐被填满;然后发送内存警告,您将看到内存很快被释放(直到某个点)。这是健康应用程序的标志。

您应该担心的是,当发出内存警告时,内存不会恢复。但是你的应用程序会立即被杀死。

因此,内存警告 + 应用程序不崩溃完全不用担心。

于 2012-08-01T17:39:28.820 回答