Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 805
YvesLeBorg Avatar asked Oct 07 '13 20:10

YvesLeBorg


3 Answers

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.

like image 196
YvesLeBorg Avatar answered Nov 15 '22 03:11

YvesLeBorg


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.

like image 21
LearnCocos2D Avatar answered Nov 15 '22 05:11

LearnCocos2D


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?

like image 40
Rob Segal Avatar answered Nov 15 '22 04:11

Rob Segal