Troubleshooting Memory Issues

Discussion in 'iPod touch' started by studangerous, Feb 9, 2009.

  1. studangerous

    studangerous Super Moderator Emeritus Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    5,975
    Likes Received:
    30
    Device:
    iPhone 4 (Black)
    RAM Memory Management & Troubleshooting

    Are you experiencing frequent crashes? Does loading an application seem to take forever? If the answer is yes then you've probably got a problem with your RAM (Random Access Memory). Here's a little guide on how to identify the problems, fix them and how to better manage your RAM.

    Background Info

    The iPod Touch and iPhone have 128MB SDRAM, which is the current standard for high-end smart phones. There is no memory swap facility to the larger storage solid state flash drives as their is a risk that continuous writing to the flash disks may damage them. N.b. solid state flash memory has a very long life span but each sector has a finite life measured in the number of times it is written to (currently in the 300,000 to 1,000,000 range), so all of your iPod Touch's operations and applications have to use this single 128MB stick of RAM.

    Jailbreak Free Apple Purist?

    If you are running an un-jailbroken device you shouldn't experience any major memory issues.

    Applications on the Appstore are prevented from running in the background, so Appstore applications only access RAM when they are open and this RAM is released again as soon as the application is closed. Only the stock Apple applications (phone, email, Safari etc.) and system processes have permission to run in the background. Thus an un-jailbroken iPod Touch should have a high level of memory stability. However if, for example, you've just opened 5 internet pages on Safari, have email 'push' turned on and try to run a graphic intensive game and receive an SMS it at the same time it's plausible you could experience a crash. If you do, simply free up the memory by either closing all applications running in the background (hold the home button for 6 seconds) or reboot/hard reboot your device (either power off as normal, or hold the power & home buttons until it powers off and release when you see the boot screen Apple logo).

    See the end of this post for some Appstore apps to help you manage your RAM.

    Jailbreak

    If you are jailbroken, it's highly likely that you will run into some memory issues sooner or later. You've probably already installed a number of cool little applications, themes and hacks from Cydia. Many of these may make use of 'daemons' or Springboard 'mobile substrate hooks' and so run in the background using up your precious RAM. Daemons block up RAM, constantly leech battery and processor power. Springboard mobile substrate hooks just use up RAM when they are in use.

    Daemons

    If possible, daemons should be avoided at all costs. Knowing which of your apps run daemons and how bad those daemons are is the main problem.

    First off, you can presume that anything and everything on your device that is either running, updating or providing information, while you are not actively using it, is using a daemon. Some of these are sleek and low profile and shouldn't be worried about at all, such as SSH, while others tend to be real hogs. Fortunately most developers have realised the extent of the negative effect of daemons and so choose to opt for the sleeker mobile substrate hook these days.

    There are several ways to check what daemons may be running at an given time.

    Using MobileTerminal

    The ps command

    • 1. Install MobileTerminal from Cydia (it's on the Telesphoreo community source);
    • 2. Open MobileTerminal and hold your iPod Touch in Landscape view to rotate the screen. Type in ps -A (case sensitive!) to list the processes currently running. You can scroll up and down the Terminal screen by swiping up and down on the right hand side of the screen.

    The output will look something like this:

    Please Register or Log in to view images



    n.b. Safe core processes (system daemons) are: launchd; mDNSResponder; notifyd; syslogd; configd; update; lockdownd; /usr/sbin/mediaserverd; /System/Library/PrivateFramworks/IAP.framework/IAP; fairplayd; /System/Library/CoreServices/SpringBoard.app; CommCenter; /usr/sbin/BTServer

    If you have an iPhone you should also see /var/stash/Applications.xBZx31/MobilePhone.app running and you should all also see MobileTerminal running as /var/stash/Applications.xBZx31/Terminal.app. You may also see /var/stash/Applications.xBZx31/MobileMusicPlayer.app and /var/stash/Applications.xBZx31/MobileSafari.app running, though these can be closed and their memory freed up at anytime by restarting your device.

    The 'ttysxxx' data can be ignored.

    Any other processes are likely to be 3rd party daemons. e.g. as you can see, on my device I have /Applications/MxTube.app/MxT2d which is a daemon run by MxTube.

    Next run the terminal command ps v -A. This will show you how how much memory each process is running. You can then make a decision on whether you want to uninstall particular application.

    Please Register or Log in to view images



    As you can see, system apps are using up 62MB of the RAM (pretty normal). The MXTube daemon is using up 0.8MB.


    The top command

    If you want to go even deeper and look at your running processes in real-time then you can use the top command. The process for installing and using this command is below but I won't go into decyphering the output.

    • Install the Unix 'top' command from Saurik's site. Do this by typing the following command lines into MobileTerminal:
      Code:
      su root
      alpine
      apt-get install top
      
      (note that if you have changed your device's password from 'alpine' to something else then use that password instead of alpine when prompted);
    • In MobileTerminal type top and you should get a real time updated view of active processes and their CPU & memory usage. Press x to switch back and forth between legacy display. Press q to end real-time monitoring.

    Mobile Substrate Hooks

    Most applications tend to use mobile substrate hooks these days as developers have got wise to the problems associated with using daemons. Still hooks use up memory and you want to limit unwanted use if possible.

    The easiest way to see what hooks are running currently is through Cydia. open Cydia

    • go to the 'Manage' tab
    • press the 'Packages' button
    • press the 'Simple' button in the top right corner to go to the Expert developer view
    • find the Mobile Substrate package.

    **IMPORTANT - DO NOT UNINSTALL MOBILE SUBSTRATE** We are going to go part of the way to uninstalling it so that it lists the hooks associated with it but we do not want to uninstall it!

    • click on Mobile Substrate
    • click 'Modify' in top right hand corner
    • Click 'Remove'
    • STOP - DO NOT, I REPEAT DO NOT PRESS CONFIRM

    What you should see is something like the image below:

    Please Register or Log in to view images



    At any time one or more of the shown 'hooks' may be using up memory. Streamline your device and get rid of any you don't need.

    NOW PRESS CANCEL. DO NOT PRESS CONFIRM!!!


    Problematic Applications

    The following applications are known to potentially cause issues and so you should consider their effect on the stability of your device when using them.

    Intelliscreen - hooks to the springboard without using mobile substrate and is probably the major reason Saurik added the 'Safe Mode' to Cydia. Will also add pull on your battery CPU and RAM. Saurik recommends avoiding Intelliscreen until the author makes it a mobile substrate plug-in, due to the system wide instability it can cause.

    Kate - hooks to the spring board without using mobile substrate, similar to Intelliscreen, so is best avoided.

    Video & Auto Change Wallpapers - Can hog CPU and add extra pull on the battery as they constantly run video or a backgrounded app to change the wallpaper. May also use up additional RAM to cache images/video. Some apps better programmed and optimised than others.


    Applications For Managing Memory

    Appstore Apps

    Free Memory 1.4 $0.99
    http://appshopper.com/utilities/free-memory

    Please Register or Log in to view images




    Memory Status $0.99
    http://appshopper.com/utilities/memory-status

    Please Register or Log in to view images




    Memory Monitor $0.99
    http://appshopper.com/utilities/memory-monitor

    Please Register or Log in to view images




    iStat - System Monitoring $1.99

    http://appshopper.com/utilities/istat-system-monitoring

    Please Register or Log in to view images




    Cydia Apps

    SBSettings Free!

    On the BigBoss repo. You probably have this already and if you don't you should consider getting it now. A BossPref's replacement that you activate from within any app by swiping on the title bar. The stock app gives a readout of free RAM and you can install the 'Processes' widget from the BigBoss community source which allows you to kill background processes without restarting. Highly recommended.

    Please Register or Log in to view images




    SysInfoPlus Free!

    On the BigBoss Repo. A bells and whistles system info and process manager with ability to kill or terminate any running process.
    [thanks to pickaxe for pointing the app out to me]

    Please Register or Log in to view images




    Mem Tool (Postflight Process Manager) Free!
    ht
    On the iSpazio Community Sources repo. A very useful application and better than SB Settings' process-kill widget as it shows all running processes and allows you to kill any of them (but be careful not to kill your system tasks!).
    [thanks to jimbeam for pointing the app out to me]

    Please Register or Log in to view images



    ----------------------------------------------------------

    *research and information for this thread taken from numerous sources, though the most helpful, useful and informative source on this subject was this one at BigBoss's site and so reference (and due respect) must be given.
  2. macfanboy

    macfanboy New Member

    Joined:
    Jan 2, 2008
    Messages:
    469
    Likes Received:
    0
    Device:
    iPod touch
    I LOVE THIS!! tks sooooooo much answered so many questions
  3. himynameisjuan

    himynameisjuan Member

    Joined:
    Aug 2, 2008
    Messages:
    344
    Likes Received:
    0
    Device:
    2G iPod touch
  4. thechungster

    thechungster Super Moderator Emeritus

    Joined:
    Dec 8, 2007
    Messages:
    6,886
    Likes Received:
    4
    Device:
    iPhone 4 (Black)
    Woah, nice thread

    Please Register or Log in to view images

    I sense a sticky.
  5. ipodtouchfeen

    ipodtouchfeen Member

    Joined:
    Mar 17, 2008
    Messages:
    170
    Likes Received:
    0
    Device:
    iPhone 4 (Black)
    this deserves a rat trap sticky!!!! lol
  6. jimbeam

    jimbeam Active Member

    Joined:
    Nov 19, 2007
    Messages:
    3,694
    Likes Received:
    12
    Device:
    iPhone 3G (Black)
  7. Ryan

    Ryan Well-Known Member

    Joined:
    Jan 19, 2008
    Messages:
    4,129
    Likes Received:
    28
    Device:
    Nexus 4
  8. sprint_user

    sprint_user New Member

    Joined:
    Apr 27, 2008
    Messages:
    2,864
    Likes Received:
    1
    Device:
    iPad 2 (Black)
    Same here

    Please Register or Log in to view images

    Please Register or Log in to view images

    , awesome job!
  9. M.J.B.

    M.J.B. New Member

    Joined:
    Dec 22, 2008
    Messages:
    180
    Likes Received:
    0
    wow, just wow this is amazing and will be very useful
  10. studangerous

    studangerous Super Moderator Emeritus Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    5,975
    Likes Received:
    30
    Device:
    iPhone 4 (Black)

Share This Page