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 08-11-2010, 08:30 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default Navigation Controller problems

Hi, I have an app that has alot of view and when I navigate to a view with an image on it the memory goes from 2mbs used to 15mbs used and then return to the previous view the memory stays at 15. I have released the images on the view and the memory still doesnt release. Please help.
thomas02 is offline   Reply With Quote
Old 08-11-2010, 09:14 PM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

If you simulate a memory warning, does it go back down?
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-11-2010, 09:28 PM   #3 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
If you simulate a memory warning, does it go back down?
No it doesnt
thomas02 is offline   Reply With Quote
Old 08-11-2010, 09:29 PM   #4 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Post some code then.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-11-2010, 09:33 PM   #5 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

Im new a development and dont know what to post sorry.
thomas02 is offline   Reply With Quote
Old 08-11-2010, 09:34 PM   #6 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Well, you think the problem is related to images, then post code related to images. Where you create them, how you use them, how you destroy them, etc.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-11-2010, 09:38 PM   #7 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Well, you think the problem is related to images, then post code related to images. Where you create them, how you use them, how you destroy them, etc.
in my .h

@property(nonatomic,retain)IBOutlet UIImageView *fast1;
@property(nonatomic,retain)IBOutlet UIImageView *fast2;
in the .m

- (void)viewDidDisappearBOOL)animated {
[super viewDidDisappear:animated];
NSLog(@"release");
[fast1 removeFromSuperview];
[fast2 removeFromSuperview];
[texts removeFromSuperview];
}


- (void)dealloc {
NSLog(@"Releasing");
[fast1 release];
[fast2 release];
[texts release];
[super dealloc];
}
i just add them in IB and attach the outlet so I can remove them and release the mem.
thomas02 is offline   Reply With Quote
Old 08-11-2010, 09:40 PM   #8 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Do you see the "Releasing" log?

Removing from superview isn't necessary, btw. If that is the only reason you have the outlets, don't bother.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-11-2010, 09:42 PM   #9 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Do you see the "Releasing" log?

Removing from superview isn't necessary, btw. If that is the only reason you have the outlets, don't bother.
In the log I see that they are releasing. So I can still release them if I dont have and outlet for them?
thomas02 is offline   Reply With Quote
Old 08-11-2010, 09:46 PM   #10 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

You don't need to. The view will release the imageviews - which will in turn release the images - when the view controller goes away.

I'm not seeing any errors in the code here, so as long as you are certain that the view controller is dying, I wouldn't worry about it. You're probably just seeing the image cache.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-11-2010, 09:48 PM   #11 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
You don't need to. The view will release the imageviews - which will in turn release the images - when the view controller goes away.

I'm not seeing any errors in the code here, so as long as you are certain that the view controller is dying, I wouldn't worry about it. You're probably just seeing the image cache.
How do I tell if the view controller is dying? When I navigate back from the view with the images the memory used goes up.
thomas02 is offline   Reply With Quote
Old 08-11-2010, 09:49 PM   #12 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

If you are seeing that log in the dealloc method, then the view controller is dying.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-11-2010, 09:51 PM   #13 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
If you are seeing that log in the dealloc method, then the view controller is dying.
ok thanks
thomas02 is offline   Reply With Quote
Old 08-11-2010, 09:52 PM   #14 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

If you go forward and back a bunch of times, does the memory keep growing, or does it stay around 15?
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-11-2010, 09:55 PM   #15 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

I just ran it through again and the log showed a level 1 memory warning.
thomas02 is offline   Reply With Quote
Old 08-11-2010, 09:56 PM   #16 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
If you go forward and back a bunch of times, does the memory keep growing, or does it stay around 15?
It grows and shrinks about .2 mbs every time
thomas02 is offline   Reply With Quote
Old 08-11-2010, 09:56 PM   #17 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

That doesn't answer my question.

Edit: Ok, if you were leaking, then you would continue to grow and grow. If it stays the same, you aren't leaking.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-11-2010, 10:00 PM   #18 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

when running it in instruments, the leaked bytes just keeps growing and the memory used keeps growing and growing.
thomas02 is offline   Reply With Quote
Old 08-11-2010, 10:03 PM   #19 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Get your story straight. Just a minute ago you said it would grow and shrink.

So since you are using Instruments, you should be able to figure out what kind of objects are leaking.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-11-2010, 10:07 PM   #20 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Get your story straight. Just a minute ago you said it would grow and shrink.

So since you are using Instruments, you should be able to figure out what kind of objects are leaking.
It tells me the only leak discovered is an array.
thomas02 is offline   Reply With Quote
Old 08-11-2010, 10:08 PM   #21 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Ok, are you using any arrays in this view controller?
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-11-2010, 10:12 PM   #22 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Ok, are you using any arrays in this view controller?
No, but I have many in the rest of the app.
thomas02 is offline   Reply With Quote
Old 08-11-2010, 10:13 PM   #23 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Start tracking those down, then.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-11-2010, 10:14 PM   #24 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Start tracking those down, then.
Ok
thomas02 is offline   Reply With Quote
Old 08-11-2010, 10:24 PM   #25 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 28
thomas02 is on a distinguished road
Default

I have released all of the arrays and it still gives me warnings for them leaking memory and now the app is really slow and then it crashes.
thomas02 is offline   Reply With Quote
Reply

Bookmarks

Tags
memory, navigation, view

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: 356
6 members and 350 guests
bignoggins, Chickenrig, givensur, linkmx, Objective Zero, PlutoPrime
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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