 |
 |
|
 |
01-06-2009, 01:33 PM
|
#1 (permalink)
|
|
Lost in a sea of code
Join Date: Apr 2008
Location: Boston
Posts: 388
|
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.
|
|
|
01-06-2009, 02:17 PM
|
#2 (permalink)
|
|
Magic Hands' Daddy
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 22
Posts: 1,372
|
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.
|
|
|
01-06-2009, 02:31 PM
|
#3 (permalink)
|
|
New Member
Join Date: Sep 2008
Posts: 1,431
|
Do you use IB and do you release outlets? Not doing this correctly will lead to memory warnings.
|
|
|
01-06-2009, 02:32 PM
|
#4 (permalink)
|
|
Registered Member
Join Date: May 2008
Posts: 583
|
The iPhone OS is suppose to reclaim memory after an application is closed. It does not always work like it should.
|
|
|
01-06-2009, 02:38 PM
|
#5 (permalink)
|
|
Lost in a sea of code
Join Date: Apr 2008
Location: Boston
Posts: 388
|
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:
|
|
|
01-07-2009, 07:23 AM
|
#6 (permalink)
|
|
Registered Member
Join Date: Oct 2008
Posts: 486
|
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.
|
|
|
01-07-2009, 10:25 AM
|
#7 (permalink)
|
|
New Member
Join Date: Sep 2008
Posts: 1,431
|
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.
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» 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 |
|