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 09-11-2011, 09:28 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 8
carsonp is on a distinguished road
Default I need a little help fixing a memory leak

I am working on an app and am having a problem with a memory leak (according to instruments) and I could use a hand as I am not too great with knowing exactly when to release something.

I've narrowed down the source of the leak to one class and who ever feels up for the challenge of helping me I will PM them the file and the screenshot of the leak from instruments.

I would greatly appreciate the help from someone. I'm still a noob at this when it comes to memory management. Reply if you are up for the task.
carsonp is offline   Reply With Quote
Old 09-11-2011, 09:36 PM   #2 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Just post the class here or at Pastebin.com - #1 paste tool since 2002!.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 09-11-2011, 09:43 PM   #3 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 8
carsonp is on a distinguished road
Default

Quote:
Originally Posted by Domele View Post
Just post the class here or at Pastebin.com - #1 paste tool since 2002!.
here's the .h [Objective C] // // placesViewController.h // That One Place // // Created by Carson Pe - Pastebin.com
the .m [Objective C] // // placesViewController.m // That One Place // // Created by Carson Pe - Pastebin.com

and the screenshot of the leak http://f.cl.ly/items/0g0v1E3W1Y431v2...35.05%20PM.png


thanks
carsonp is offline   Reply With Quote
Old 09-11-2011, 10:00 PM   #4 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

If you double click those leaks, it should show you which line is leaking.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 09-11-2011, 10:14 PM   #5 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 8
carsonp is on a distinguished road
Default

Quote:
Originally Posted by Domele View Post
If you double click those leaks, it should show you which line is leaking.
It's very vague and I'm not sure what needs to be done to fix it. That's why I'm asking for help.
carsonp is offline   Reply With Quote
Old 09-11-2011, 10:17 PM   #6 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Well which line does it point to? That'd probably help a lot.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 09-11-2011, 10:20 PM   #7 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 8
carsonp is on a distinguished road
Default

Quote:
Originally Posted by Domele View Post
Well which line does it point to? That'd probably help a lot.
Almost all seem to point to

[self presentModalViewController:addView animated:YES];

on 179
carsonp is offline   Reply With Quote
Old 09-12-2011, 09:11 AM   #8 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by Domele View Post
If you double click those leaks, it should show you which line is leaking.
Actually, the instruments tool usually points to the line that originally creates the leaked object, not the offending code.

I suggest running static analysis on your code. In XCode 4, it's in the product menu, and is simply called "analyze." I don't remember where the analyze command was in XCode 3, since XCode 4 is totally, utterly different in every possible way from XCode 3, for no apparent reason.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 09-12-2011, 11:30 AM   #9 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 8
carsonp is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
Actually, the instruments tool usually points to the line that originally creates the leaked object, not the offending code.

I suggest running static analysis on your code. In XCode 4, it's in the product menu, and is simply called "analyze." I don't remember where the analyze command was in XCode 3, since XCode 4 is totally, utterly different in every possible way from XCode 3, for no apparent reason.

I ran the Clang analyzer and fixed all the errors it pointed out. This error is the one left after the analyzer says is all clear.
carsonp is offline   Reply With Quote
Reply

Bookmarks

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: 405
10 members and 395 guests
7twenty7, apatsufas, Eclectic, eski, fiftysixty, JackReidy, teebee74, tim0504, UMAD, yuncarl28
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,904
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

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