1

I'm still a newb to objective C and Xcode 5. I have made a simple game and was performing some analysis on the game's memory leaks using one of Xcode's built in performance tools (Cmd+I). To make the game I was using cocos2D framework.

Now it looks like I had quite a few memory leaks (screenshot below). A few things I wanted to address were (keep in mind it's a really small game)

  • Are the memory leaks being shown significant? Or is it normal to have a few memory leaks in the bytes-kbytes range?
  • Many of them are "Malloc -" and have no trace in the Extended Detail view. How do you deal with these?
  • I know Xcode has the option to turn on Objective-C ARC. Would it be a better idea for me to just turn that on instead of worrying about keeping track of memory leaks and all of that? (keep in mind I'm a newb)

Thanks, here's the screenshot!

enter image description here

spaderdabomb
  • 942
  • 12
  • 28

1 Answers1

2

I think the more important thing about memory leaks is how often does it occur. If it happens on app load once, i don't think it will matter that much, but if it happens in a loop or after every user action then I think it is something to be worried about.

And I definitely recommend using ARC, that question has been posted to SO many times, here you can find better answers than I could ever give.

ARC, worth it or not?

To ARC or not to ARC? What are the pros and cons?

To use Automatic Reference Counting or not to use

Community
  • 1
  • 1
Slavenko Miljic
  • 3,836
  • 2
  • 23
  • 36