YvesLeBorg
YvesLeBorg

Reputation: 9089

constant app memory increase ( IOAccelResource )

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 prepping an AppStore update to account for some iOS 7 issues (mine, not iOS7).

My own instrumentation, as well as Instruments, show no leaks, no abandoned memory, nothing... flat. This also used to be the case under iOS 4,5,6.1. However, in my test rundown prior to submission, when profiling on device, i see a 1Mb increase per 2 minutes, with the game sitting idle, ie no user interactions whatsoever (see pic below).

enter image description here

The only thing i can see is this IOAccelResource category running amuck between generation capture.

  1. Would you have any suggestions as to what could that be ?

  2. I cant find much about an IOAccelResource ... can anyone of you point me in the right reading direction ? If this is indeed cocos2d related, i would not mind digging in there, but i dont know where to start looking.

  3. Also, i would like to run with 'as close to release' a build as possible, and still be able to measure the memory footprint over time. Could you suggest me a method for measuring process size ?

    tia.

Upvotes: 5

Views: 1964

Answers (5)

YvesLeBorg
YvesLeBorg

Reputation: 9089

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.

Upvotes: 1

Ricardo Sanchez-Saez
Ricardo Sanchez-Saez

Reputation: 9566

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

Upvotes: 1

YvesLeBorg
YvesLeBorg

Reputation: 9089

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.

Upvotes: 2

Rob Segal
Rob Segal

Reputation: 7625

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?

Upvotes: 1

CodeSmile
CodeSmile

Reputation: 64477

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.

Upvotes: 1

Related Questions