Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-08-2010, 01:51 AM   #1 (permalink)
Registered Candy Bar
 
DrBeak1's Avatar
 
Join Date: Nov 2010
Location: San Jose, CA
Posts: 298
DrBeak1 is on a distinguished road
Default Memory management question.

Let me preface this with the fact that I still consider myself a noob to the programing world.

I ran my app in the simulator with the leaks instrument. I found that when I loaded/viewed a certain UIViewController that a number of leaks arose. I've been very mindful (or at least thought I was) of memory management but went back over my code for this view and quadruple checked that in every instance of an alloc, init, etc that I released the object. I can't find any reason why I'm leaking.

As a noob, I'm also new to the leaks instrument but I found what appears to be the leak instrument indicating that the leaks were coming from NSDateComponants (responsible frame: UIDatePickerView) and Malloc (responsible frame:UIKeyboardInputManagerClassForInputMode). Following the assumption that the leaks instrument is pointing to these objects as the leaky culprits I again looked at my code pertaining to these objects, but everything looks fine.

QUESTION: Aside from the "fundamental rule" of memory management are there other places where issues commonly arise that would be worth checking? And am I correct in assuming that the leak instrument is pointing me towards those objects because they are at fault?
DrBeak1 is offline   Reply With Quote
Old 12-08-2010, 02:29 AM   #2 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 223
Chilibird is on a distinguished road
Default

Leaks, unfortunately, isn't perfect and may present false positives. My understanding is that this is especially true if you do any threading in your code. Due to the nature of how threads and their memory are handled, Leaks may think that an object was leaked when in fact it was properly taken care of (I know I ran into this in my newest app)

In other words, Leaks is great to catch some stuff, but there's no replacement for the human touch
Chilibird is offline   Reply With Quote
Reply

Bookmarks

Tags
management, memory, memory management

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 390
7 members and 383 guests
chemistry, daudrizek, HemiMG, jeroenkeij, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,665
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, daudrizek
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:55 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0