Cocos2D/iOS7: continuously increasing memory usage for boilerplate code

前端 未结 3 841
眼角桃花
眼角桃花 2021-02-15 13:58

This is what it looks like with iOS7 simulator when application is just running without any user interaction(also I\'m not running any code of mine, only boilerplate Cocos2D):

相关标签:
3条回答
  • 2021-02-15 14:23

    Not so much an answer as a confirmation: it seems to be a problem specific to iOS 7.0 and cocos2d 2.1.

    I observed the same behavior: cocos2d 2.1 on iOS 7.0 simulator increases memory usage over time. And a lot, too, every few seconds by ~1 MB. But let's disregard that, the Simulator is not a real device.

    On a device (iPod touch 5th gen with iOS 7) memory is barely going up. Using marked generations over a period of 5 minutes indicates a growth of at most 15 KB. Occasionally there is a block of 10-15 KB allocated but eventually let go, at least most of it. The amount of memory added and sticking around over a 5 minute period is about 5 KB. Not much, but also more than nothing for a template app that doesn't do or respond to anything.

    The memory that is added and never released on the device is mostly marked as <non-object> as in the Simulator, with a few CGPath thrown in between. So this may indicate that there could be a memory management issue in cocos2d 2.1 on iOS 7 - though it's too minor to have any negative effect on most apps (~100 KB "leaked" per hour).

    Sprite Kit and OpenGL applications as well as running on a iOS 6 Simulator (I couldn't test on a iOS 6 device) don't show any such issue, live bytes remains steady with marked generations reporting no growth at all.

    0 讨论(0)
  • 2021-02-15 14:23

    Are you sure you don't have zombie objects enable?

    Click on your product -> Edit scheme and at diagnostics tab if you have "Enable zombie objects" checked, uncheck it and try again.

    0 讨论(0)
  • 2021-02-15 14:32

    I know this is too late to reply this issue but just leave it here. There is a guy talk about nszoombie, so if you enable debug of xcode with this option, it will cause this issue. Turn it off and check again

    0 讨论(0)
提交回复
热议问题