Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a weird issue - my app is leaking memory on device only, not on a simulator. It is leaking if i schedule update method anywhere, on any scene. It is leaking despite update method is empty, there's nothing inside it except NSLog. How can it be? I have even scheduled update on the very first scene where it seems there's nothing to leak, and scheduled another empty and it's leaking or not leaking but allocating something, the result is the same - the volume of the memory consumed is increasing and my app is crashing soon. I can detect the leakage via using Instruments->Memory->Activity Monitor or with help of following function:

void report_memory(void) 
 {
  struct task_basic_info info;
  mach_msg_type_number_t size = sizeof(info);
  kern_return_t kerr = task_info(mach_task_self(),
                           TASK_BASIC_INFO,
                           (task_info_t)&info,
                           &size);
  if( kerr == KERN_SUCCESS ) 
  {
     NSLog(@"Memory in use (in bytes): %u", info.resident_size);
  } 
  else 
  {
     NSLog(@"Error with task_info(): %s", mach_error_string(kerr));
  }
}

Can anyone explain me what's going on?

share|improve this question
I have the same weird issue... help please.. – Pcoder Nov 22 '12 at 7:16
I recommend you to use Xcode instruments. if you rely on function adduced by me don't do it. just examine your program flow with Instruments Allocations and you'll find the source of your problem. This is what i did – Andrey Chernukha Nov 22 '12 at 7:57
@Andrey, if you've found a solution to your problem please post it as an answer and mark it as the correct answer. – Noctrine Nov 22 '12 at 19:21

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.