Question to Developers: Best way to reset phone?

Discussion in 'iOS Apps' started by redman042, Dec 19, 2008.

  1. redman042 macrumors 68020

    Joined:
    Jun 13, 2008
    #1
    Many app publishers (games in particular) advise to reset the phone after installation to clear out the RAM before running the game. This helps with games that hog memory like X-Plane and Sim City.

    Most of the time the recommendation is to Hard Reset (ie. hold down top button and home for 10 seconds), rather than just a normal "power off".

    I'd like to ask software developers - those who have access to the SDK and understand what's going on behind the scenes - what the true difference is between these two methods. Is one method better than the other? Is a hard reset "riskier" to the data integrity on the phone?

    I'd prefer to do a power off/ power on as it takes less time and seems to be more of a controlled shutdown that would save open files and such before turning off. Hard reset seems like more of a brute-force approach, one that could potentially interrupt a file write operation.

    Insight on this issue from those in the know is appreciated!
     
  2. Delirium39 macrumors regular

    Joined:
    May 19, 2008
    #2
    As far as I know, pressing the power button doesn't really turn off the device. It just goes into standby/sleep mode. Developers want you to do a hard reset, because that is what actually shuts the device down. And the reason it takes so long is because everything is being shutdown correctly. You can turn on/off via the power button a million times, and it won't clear your ram at all, because nothing is really happening, except going into sleep mode.
     
  3. DigMe macrumors 6502

    Joined:
    Sep 9, 2008
    #3
    I think he's referring to when you hold down the top button until you get the "Slide to power off" screen, not just putting it to sleep. The former actually does turn it off.
     
  4. jaseone macrumors 65816

    jaseone

    Joined:
    Nov 7, 2004
    Location:
    Houston, USA
    #4
    I can't see how that is any faster than a hard reset though...
     
  5. Delirium39 macrumors regular

    Joined:
    May 19, 2008
    #5
    Ahh, you may be right! My bad! :)
     
  6. DigMe macrumors 6502

    Joined:
    Sep 9, 2008
    #6
    I would say that the question is not "Which is faster?" but "Is there a difference between the two and is one 'safer' or better than the other?" It seems that perhaps there might be a difference since doing the "Slide to power off" method seems to allow the phone to shut down processes and wrap everything up on its own time. Kind of like the difference between turning a computer off via the shutdown process vs. holding down the power button. I've seen conversations here before where people claimed that the Slide-to-power-off method is better for the phone but I've never seen any hard evidence one way or the other...just speculation.
     
  7. DreamPod macrumors 65816

    Joined:
    Mar 15, 2008
    #7
    I would guess some developers are saying that because there is no confusion involved. Whereas if you just tell someone to turn off the power they may not realize that hitting the reset button doesn't count, and if you tell someone to hold the reset button they may not hold it long enough. But tell someone to hold the Home and Reset button down until the system resets, that's nice and easy to convey exactly what you mean in one simple sentence.

    Personally, I turn the power off normally (hold the reset button until the "Turn Power Off" slider appears and slide it). But most developers won't know if that's any "safer", because Apple doesn't give us that much detail on how the system works. Heck, Apple doesn't even tell us how much memory the system has! (I know, 128MB RAM, but I didn't read that from Apple's docs).
     
  8. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #8
    AFAIK, a hard reset (hold both buttons) is really just for if there's a crashed device or locked-up app, and there's no other way to reset. Otherwise it appears to kill processes without giving them a chance to clean up and save any unsaved data.

    If holding the top button for a slide-to-reset works, that allows for much safer shutdown, with less likelyhood of any lost data/email/SMS messages, etc.

    Just pressing the top button quickly and watching the screen go dark doesn't even power-off the device; apps can still run for some number of seconds after the display turns off.

    .
     
  9. extralarge macrumors member

    Joined:
    Dec 15, 2008
    #9
    I would recommend, do not do the 'hard' way until your phone is crashed or stucked by the app. it's harmful.
     
  10. NeptuneStudios macrumors newbie

    Joined:
    Dec 20, 2008
    Location:
    Canada
    #10
    From my experience, if you are getting crashes or other problems, always do a hard reset. The biggest culprit is apps leaking memory and those might not always be cleaned up. Putting it to sleep does not do anything in terms of cleaning things up.

    For my phone, I do a hard reset every 2 weeks or so, or whenever one of the apps start acting funky.
     
  11. redman042 thread starter macrumors 68020

    Joined:
    Jun 13, 2008
    #11
    Thanks for the feedback. Wow, I'm surprised how little Apple tells the developers. I don't know how one designs an app without clear guidance on how much RAM you have to work with!

    I also don't see why they don't allocate more RAM than 128 MB. Isn't it all coming out of the same 8 or 16 GB pool, or is there a different chip for program RAM?
     
  12. DigMe macrumors 6502

    Joined:
    Sep 9, 2008
    #12
    Again no one is talking about putting it to sleep. We're talking about two different ways of turning the power off. I think both methods would clear the memory.
     
  13. DigMe macrumors 6502

    Joined:
    Sep 9, 2008
    #13
    And that statement is based on.. what?
     
  14. redman042 thread starter macrumors 68020

    Joined:
    Jun 13, 2008
    #14
    Startup after a hard reset seems to take much longer than after a soft reset. So there is certainly a difference.
     
  15. DreamPod macrumors 65816

    Joined:
    Mar 15, 2008
    #15
    Actually, the system has real RAM in it - the on-board 8/16GB memory card chips are very very slow, they couldn't really be used for RAM. Yeah, I always found it odd -the documentation says all over the place to use as little memory as possible, but nowhere does it give any hints as how much "little" is. To a PC game designer, for example, 128MB is hardly any memory anymore. Of course, to a Nintendo DS programmer, 128MB is a dream :)
     
  16. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #16
    It's based on the fact that killing processes without giving them a chance to clean up can leave a mess behind: half written files, non-updated settings, inconsistent flash file directory information (can be very dangerous), etc.

    If the file directory isn't cleanly shut down, it can take a lot longer to check and rebuild on startup (and may not rebuild correctly, which can occasionally result in lost or damaged files).

    One of the things that slide-to-reset appears to do is to cleanly close the file system.

    .
     

Share This Page