Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.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 01-06-2009, 01:33 PM   #1 (permalink)
Lost in a sea of code
 
BostonMerlin's Avatar
 
Join Date: Apr 2008
Location: Boston
Posts: 388
Default Low memory warning until reboot

i've heard of some graphics intensive games needing to be rebooted prior to running else crashes would occur.

My app (like many) uses a heavy dose of tableviews to perform most of it's functions. Lately my apps been causing memory warning after navigating through a series of screens. i could replicate the hit on memory by accessing nine table levels in a row. over and over i could cause my 3g to issue a memory warning. each time, exit the app, restart the app and replicate the problem (not in debug mode or instruments.. just on it's own).

if i reboot my 3g, run the app, do the same thing.. no problem.. no warnings. Can anyone shed light on why this happens? I'm sure i have leaks hanging around that i need to fix but why would a reboot fix the problem? Would you think it possible that xcode leaves debugger stubs on the device that might cause some of these issues?

anyone else experiencing this? Thoughts?

Thanks,
John
__________________
----------------------------------------------------------------------
I love being a dad, flying airplanes and writing code.
----------------------------------------------------------------------
Follow me on Twitter: @BostonMerlin
Feed your brain on Twitter: @iPhoneDev101
----------------------------------------------------------------------
iPhone Apps:

Last edited by BostonMerlin; 01-06-2009 at 02:07 PM.
BostonMerlin is offline   Reply With Quote
Old 01-06-2009, 02:17 PM   #2 (permalink)
Magic Hands' Daddy
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 22
Posts: 1,372
Send a message via ICQ to smithdale87 Send a message via AIM to smithdale87 Send a message via Skype™ to smithdale87
Default

just b/c your app doesnt have leaks does not mean that other apps that you use don't have leaks.

When you run other apps, they leak. Then your app is left with less memory to work with.

Rebooting causes memory to be cleared, so now if you test your app on a fresh device, you'll find that you have much more memory to work with.
__________________
Games
AppRoach - (v1.0)
7 Deaths In Nagamachi (v1.1)
Segment (v1.2)
ThumStruck Free (v1.5)
Plummet - new (v1.0)
ThumStruck 2! - Coming Soon

Apps
ArtsMemphis - (v1.0)
Elvis Mobile (v1.1)
DataLoss DB - (v1.1)
Lovers & Haters - (v1.0)
smithdale87 is offline   Reply With Quote
Old 01-06-2009, 02:31 PM   #3 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 1,431
Default

Do you use IB and do you release outlets? Not doing this correctly will lead to memory warnings.
PhoneyDeveloper is offline   Reply With Quote
Old 01-06-2009, 02:32 PM   #4 (permalink)
Registered Member
 
tkilmer's Avatar
 
Join Date: May 2008
Posts: 583
Default

The iPhone OS is suppose to reclaim memory after an application is closed. It does not always work like it should.
tkilmer is offline   Reply With Quote
Old 01-06-2009, 02:38 PM   #5 (permalink)
Lost in a sea of code
 
BostonMerlin's Avatar
 
Join Date: Apr 2008
Location: Boston
Posts: 388
Default

The crux of my question was related to why would reseting the device cause those memory warnings of mine to go away.

I was under the assumption that the device was designed to place apps in their own sandbox so as not to bring down the phone when a single app runs amuck.

Rebooting causes my memory warnings to go away when the only thing i'm doing with this device is testing a single app.

Thanks
John
__________________
----------------------------------------------------------------------
I love being a dad, flying airplanes and writing code.
----------------------------------------------------------------------
Follow me on Twitter: @BostonMerlin
Feed your brain on Twitter: @iPhoneDev101
----------------------------------------------------------------------
iPhone Apps:
BostonMerlin is offline   Reply With Quote
Old 01-07-2009, 07:23 AM   #6 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 486
Default

You're forgetting about Apple's own apps! Mail and Safari DO NOT actually close down and free up memory when you exit to the home screen. That has proven to be the cause of 98% of my memory issues. Try it yourself... do not reboot the phone next time you can replicate the low-memory warning... instead open Safari and force-quit it by *holding* the home button for 6-8 seconds (until Safari finally disappears). Do the same thing for Mail. Now try your app again... you probably (as in I'd place bets!) wont have a memory warning after that.
CommanderData is offline   Reply With Quote
Old 01-07-2009, 10:25 AM   #7 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 1,431
Default

You need to use the performance tools to see memory usage. You can see how much is used by all the apps running on the device. Also look in the console for messages about memory usage.

My observations are these. When your app gets memory warnings the background apps are also getting them. The OS will kill some of the background apps before it kills your app. Springboard can increase in size also and I think it won't be killed.

The main point is that you need to make your app run in a small footprint and respond well to memory warnings. You obviously have no control over other apps. Some game vendors tell their users to reboot the device before running their app but this seems cheesy to me. If your app is using too much memory simply by pushing and popping view controllers then that's a problem with your app.
PhoneyDeveloper 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


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 458
29 members and 429 guests
alexy, asimrs, Boh, bugman, dany88, Dmitry, DoBs, Erle, fnicola, greetings, hatembr, hg4072, ivanraso, joalta, Johanovski, KarlG, manofham, Meoz, myPhone, nikhil, ovidiu, Salman, sandman4sure, skunk, SteveMobs, thomaswguy, tychop, umop, vikysaran
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,095
Threads: 38,876
Posts: 170,546
Top Poster: smasher (2,563)
Welcome to our newest member, hg4072
Powered by vBadvanced CMPS v3.1.0

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