constant app memory increase ( IOAccelResource )

前端 未结 5 554
迷失自我
迷失自我 2021-01-13 04:47

I am trying to wrap my mind around an issue (eluded to in this question). The context is: turn-based game, developed with cocos2d version 2.0, obj-c, no ARC, currently prepp

相关标签:
5条回答
  • 2021-01-13 04:52

    The Enable Zombie Objects option on Edit Scheme > Run > Diagnostics can cause this behaviour. Be sure to disable it if you have it enabled.

    0 讨论(0)
  • 2021-01-13 04:53

    As far as I can tell , this is a bogus (probable instruments bug). When using a 'release' version of the same code base ... ie no debug ... and monitoring the process size (ie no debug process attached to the running process), the memory creep is not there.

    0 讨论(0)
  • 2021-01-13 04:58

    Ricardo has half the answer : zombies objects is part of this. You need both Zombies enabled AND an attached process to get the creep.

    In summary :

    • no zombies, no memory creep.
    • with zombies, no debug process attached, no memory creep.
    • with zombies, debug process attached, memory creep.
    0 讨论(0)
  • 2021-01-13 05:02

    Educated guess: IOAccelResource could be used by UIAccelerometer. It certainly sounds like an accelerometer I/O kind of thing.

    Since UIAccelerometer is deprecated in iOS 7 but still used by cocos2d perhaps there's an issue there Apple didn't catch or care about. Just for testing try to remove any UIAccelerometer reference from cocos2d to see if this goes away. Release builds should not affect Instruments memory monitoring, and an archive build is simply a release build from the code perspective.

    0 讨论(0)
  • 2021-01-13 05:10

    You could try monitoring allocations using heapshot analysis through Instruments. That should give you an indication as to where the additional memory is being allocated. Maybe you've already tried this?

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