[iPhone] - Memory Warnings, available RAM and development

Hello-
I keep receiving memory warnings, and occasional 101 exits from my iPhone app. According to Instruments, the RAM usage never goes above about 13MB. From what I have seen this should be well below the RAM available to apps, which I have read should be around 20-30 MB. We usually only see this after the phone has been on for a long time, with repeated builds and test sessions.
The question is, if we alloc memory during a testing phase, and then exit the app in a non-standard way (Xcode stop button), could we be leaving memory allocated, taking away the available RAM for the next build? Also, when does applicationDidReceiveMemoryWarning get called? When a certain percentage is left, a certain byte count?

Memory warnings are triggered when the OS is low on available memory - it might have nothing to do with your app. Something else happening on the device - an incoming text message, phone call, notification of some kind etc. all can cause memory warnings. With that said, you have to free up unused memory or you run the risk of your app being force quit by the OS.
There's some things you can do to help reduce your memory overhead. Only cache items you need cached, alloc and release objects as you use them rather than adding them to the autorelease pool. Auto released objects use memory until the pool is cleaned. For example creating an autoreleased NSString with
NSString* a = [NSString stringWithString:@"a"];
will get added to the autorelease pool and freed eventually. Instead, create it, use it and release it straight away.
NSString* a = [[NSString alloc] initWithString:@"a"];
// do something
[a release];
This way the memory is only allocated for the time it is in use. If you're going to use auto release pools, create them and drain them close together. I keep an autorelease pool around even though I am allocing and releasing most of my objects and then I drain the pool on a memory warning which frees up some memory.
I hope this helps, I seem to remember that the SQLite books sample code had some examples on inflating objects on demand and deflating them on receipt of a memory warning. Good luck.
Mike

Similar Messages

  • PSE 13 organizer consumes all available RAM and crashes

    I have found that I am unable to use PSE13 Organizer for more than a couple of hours without my system becoming unstable. Organizer keeps requesting RAM until it has taken up all available RAM and my virtual memory file has expanded to fill the hard drive it is on. At this point Organizer and most other running programs crash, the system becomes unstable and Windows issues  out of memory warnings. I am at a loss as to what to do about this. Does anyone know if Adobe is planning on fixing this rather major bug?
    I am running Windows 8.1 64 bit on an AMD X6 1090 with 16GB RAM.
    Thanks

    ndgreen a écrit:
    I have found that I am unable to use PSE13 Organizer for more than a couple of hours without my system becoming unstable. Organizer keeps requesting RAM until it has taken up all available RAM and my virtual memory file has expanded to fill the hard drive it is on. At this point Organizer and most other running programs crash, the system becomes unstable and Windows issues  out of memory warnings. I am at a loss as to what to do about this. Does anyone know if Adobe is planning on fixing this rather major bug?
    I am running Windows 8.1 64 bit on an AMD X6 1090 with 16GB RAM.
    Thanks
    That's the first time I see that problem on Elements forums and bug reports.
    Investigating your particular situation will require more info:
    - on your hardware, your preferences (scratch disk)
    - your organizer usage (photos or videos), autoanalyzer and other opened softwares
    - any plugins?
    What happens if you stop and restart the organizer at shorter intervals? Do you see the RAM and virtual memory grow the same way?
    The only remotely similar situation I have met on all Elements versions is the impossibility to delete a large number of files in the same batch. The Organizer slowly fills all the RAM, then issues an error message and rolls back to the situation before the delete command. No crash.

  • Hey is there anyway to delete iPhone memory when its lost and turned off?

    hey i just wanted to know if there is a way to delete or wipe everything off an iphone when its turned off and lost. including apps and msgs. basically back to factory settings. response asap will be appreciated please very urgent.

    "so there is nothing that can be done?"
    Correct.
    " like maybe calling up apple or something"
    Like any maker of any other phone, Apple can do nothing.
    Sorry.

  • LR 3.3RC still eats all available ram and swaps during preview

    I didn't see anything about ram issues being fixed in 3.3rc1...  and can confirm I'm still seeing problems.
    If I preview and rate 500 images LR starts swapping, as it ate 16gig of ram.  After that, everytime you preview a couple of more images, it swaps another chunk of ram to disk and allocates more.
    Personally, I think this is a bit excessive...
    Any word on when this will be fixed?
    Cheers!
    Mac, 64bit, 16gig ram, dual quad core processors

    It is a known and unfortunate limitation of how our current lens profile installation/uninstallation works. The workaround is to reinstall LR 3.2.

  • MacPro with10.7.3. running a Python script in terminal I see a : "There is no more application memory available on your startup disk". Python uses 10G of 16G RAM and  VM =238G with 1TB free. Log: macx-swapon FAILED - 12. It only happens with larger inputs

    On my MacPro with10.7.3. while running a Python script in terminal, after a while, in several hours actually,  I see a system message for the Terminal app: "There is no more application memory available on your startup disk". Both RAM and VM appear to be fine at this point, i.e. Python uses only 10G of 16G RAM and  VM =238G with ~1TB free. Log reads: " macx-swapon FAILED - 12" multiple times. Furthermore, other terminal windows can be opened and commands run there. It only happens with larger inputs (text files), but with inputs that are about half the size everything runs smoothly.  So the issue must be the memory indeed, but where to look for the problem/fix?

    http://liulab.dfci.harvard.edu/MACS/README.html
    Have you tried with the --diag flag for diagnostics? Or changing verbose to 3 to show debug messages? Clearly one of three things is happening;
    1. You ARE running out of disk space, but once it errors out the space is reclaimed if the output file is deleted on error. When it fails, does your output have the content generated up to the point of termination?
    2. The application (Terminal) is allocated memory that you are exceeding
    3. The task within Terminal is allocated memory that you are exceeding
    I don't know anything about what this does but is there a way to maybe run a smaller test run of it? Something that takes 10 minutes? Just to see if it works.

  • RAM and or Memory Question

    Hello,
    I have a Mac Mini (2011), and I just purchase it Tuesday, brand new. I got the i5 Model, and it came with 2gb of RAM. I got Final Cut Pro X, knowing I would need more RAM, before I even ran the program. My question is I have the DDR3 1gb card's in the computer now, I have the Old Dell To the Side (for other computing and developing purposes), this Dell has two 2gb RAM cards in it, they are both DDR3 and are made by the same company (HYNIX) as the Original Mac Mini Card's are made by. Can I use these RAM sticks in the Dell, they fit the Mac's Slot they would go in, it is DDR3 and Made by the same company, the Serial both start with the same numbers on the last 3 digits are different. SO..., can I use them in the Mac without the computer frying itself?

    Hi  xpc234
    Original HP
    641369-001     4GB, 1600Mhz, PC3-12800 memory module (SHARED)
    Equivalent Kingston:
    641369-001 KTH-X3C/4G 4GB 1600MHz SODIMM
    Crucial.com - Crucial System Scanner

  • Which Apple MacBook Pro has the most RAM and HDD memory?

    I would like to know this because I plan on buying a MacBook Pro and I just want to make sure I'm buying the one with the most RAM and HDD memory and not some other one. Why do I need specifically this? Because I'm a gamer; I like playing games. I'm a watcher too; I like watching movies. Last but not least, I would like to sync my iPhone to a device that's from the same company. I don't know why, but I guess it's because I don't like uncoordination, or something like that. In short, I don't believe in "clashing". Even electronics.

    The Hardware In Any Mac is Exactly the same as used in Any PC of like model year and included hardware. i7 being faster then an i5 CPU.
    Apple uses the same exact Intel CPUs and Chipsets that all other computer use manfacturer today. There is No difference.
    Ogelthorpe is comppletely correct that Windows, by nature of the OS, is better for running games and the hardware it comes on, by nature of the way they are manufactured even though it is the same hardware as in a Mac, is better for gaming because of the way they are cooled and the overall case design. More air vents and better air movement across the parts that get hot while gaming.
    Mac notebooks on the other hand don't cool as well by nature of the air intake and exhaust systems. Both air intake and exhaust are at the screen hinge and the fans are designed to be quieter then on most Windows PC notebooks. Even if Windows is installed on Mac that Mac will run hotter then a PC with the same exact hardware configurations. This is a fact and experienced by many Mac users. Including myself.
    Mac fans run all the time. From the second you start them up to the second they shut down completely. I personally don't know of any Windows PC notebook that do that. My Dell E6420 with the exact same CPU and more RAM, 16GBs in the Dell and 8 in my Mac, with the Dell having 2 drives, one a SSD the other a Spinner in the media bay, and the Mac having only one Seagate XT series in the main bay the Dell fans rarely come on unless I am taxing the system in some way. They are not on continuously and certainly not when I turn the system on. So Apple has designed the Mac to run the fans continuously to try and keep the system cool from the first power on.
    So your statement is completely false. But it is what most people think even though it is unfounded.
    ShaneBunting wrote:
    This is not true. The hardware is simply better on a Mac. Even when running Windows on a Mac, you'll have a far better experience than on a PC..

  • HT1338 RAM and memory is left on Macbook Pro?

    How does one check how much RAM and memory is left on their Macbook Pro? And how to I check what type of system I have on my MAC? Lion, tiger.. etc HELP

    Apple Menu > About This Mac
    This is mine:
    I have an Intel i7 processor, 8 GB RAM.  10.6 is Snow Leopard.
    10.7.x is Lion, 10.5.x is Leopard, 10.4.x is Tiger.
    For free space on the disk, go to Finder > Macintosh HD.  Then Command + i to show "Capacity" and "Available"

  • My macbook pro model mid 2009 is running slow. free memory is 35 mbs and inactive memory is  1.36 gb with a total of 5 gb RAM memory

    Problem description:
    too much inactive memory 1.87 gb and free memory only 35 mb
    EtreCheck version: 2.1.1 (104)
    Report generated 10 December 2014 3:30:26 pm IST
    Hardware Information: ℹ️
      MacBook Pro (13-inch, Mid 2009) (Verified)
      MacBook Pro - model: MacBookPro5,5
      1 2.26 GHz Intel Core 2 Duo CPU: 2-core
      5 GB RAM Upgradeable
      BANK 0/DIMM0
      1 GB DDR3 1067 MHz ok
      BANK 1/DIMM0
      4 GB DDR3 1067 MHz ok
      Bluetooth: Old - Handoff/Airdrop2 not supported
      Wireless:  en1: 802.11 a/b/g/n
    Video Information: ℹ️
      NVIDIA GeForce 9400M - VRAM: 256 MB
      Color LCD 1280 x 800
    System Software: ℹ️
      OS X 10.10.1 (14B25) - Uptime: 4:42:54
    Disk Information: ℹ️
      WDC WD5000LPVT-80G33T2 disk0 : (500.11 GB)
      S.M.A.R.T. Status: Verified
      EFI (disk0s1) <not mounted> : 210 MB
      [redacted] (disk0s2) / : 499.25 GB (142.01 GB free)
      Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
      HL-DT-ST DVDRW  GS23N 
    USB Information: ℹ️
      Apple Inc. Built-in iSight
      Apple Internal Memory Card Reader
      Apple Inc. Apple Internal Keyboard / Trackpad
      Apple Computer, Inc. IR Receiver
      Apple Inc. BRCM2046 Hub
      Apple Inc. Bluetooth USB Host Controller
    Gatekeeper: ℹ️
      Anywhere
    Kernel Extensions: ℹ️
      /System/Library/Extensions
      [not loaded] com.driver.KUSBModemCDC07 (4.0.2) [Support]
      [not loaded] com.driver.KUSBModemDataA07 (4.0.2) [Support]
    Startup Items: ℹ️
      JHHPortDetect: Path: /Library/StartupItems/JHHPortDetect
      Sudochmod: Path: /Library/StartupItems/Sudochmod
      Startup items are obsolete in OS X Yosemite
    Launch Agents: ℹ️
      [not loaded] com.adobe.AAM.Updater-1.0.plist [Support]
      [running] com.bjango.istatmenusagent.plist [Support]
      [loaded] com.google.keystone.agent.plist [Support]
      [loaded] com.oracle.java.Java-Updater.plist [Support]
      [running] jp.co.canon.CUPSCAPT.BG.plist [Support]
      [loaded] org.macosforge.xquartz.startx.plist [Support]
    Launch Daemons: ℹ️
      [loaded] com.adobe.fpsaud.plist [Support]
      [invalid?] com.adobe.SwitchBoard.plist [Support]
      [running] com.bjango.istatmenusdaemon.plist [Support]
      [loaded] com.google.keystone.daemon.plist [Support]
      [loaded] com.microsoft.office.licensing.helper.plist [Support]
      [loaded] com.oracle.java.Helper-Tool.plist [Support]
      [loaded] com.oracle.java.JavaUpdateHelper.plist [Support]
      [loaded] org.macosforge.xquartz.privileged_startx.plist [Support]
      [loaded] org.tcpdump.chmod_bpf.plist [Support]
    User Launch Agents: ℹ️
      [loaded] com.adobe.ARM.[...].plist [Support]
    User Login Items: ℹ️
      iTunesHelper Application (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
      Caffeine Application (/Applications/Caffeine.app)
      AdobeResourceSynchronizer ApplicationHidden (/Applications/Adobe Reader.app/Contents/Support/AdobeResourceSynchronizer.app)
      Dropbox Application (/Applications/Dropbox.app)
      HyperDock Helper UNKNOWN (missing value)
    Internet Plug-ins: ℹ️
      o1dbrowserplugin: Version: 5.38.6.0 - SDK 10.8 [Support]
      Default Browser: Version: 600 - SDK 10.10
      AdobePDFViewerNPAPI: Version: 11.0.09 - SDK 10.6 [Support]
      FlashPlayer-10.6: Version: 15.0.0.246 - SDK 10.6 [Support]
      Flash Player: Version: 15.0.0.246 - SDK 10.6 Mismatch! Adobe recommends 16.0.0.235
      QuickTime Plugin: Version: 7.7.3
      googletalkbrowserplugin: Version: 5.38.6.0 - SDK 10.8 [Support]
      SharePointBrowserPlugin: Version: 14.0.0 [Support]
      AdobePDFViewer: Version: 11.0.09 - SDK 10.6 [Support]
      zako: Version: zako 1.0.0.0 - SDK 10.8 [Support]
      iPhotoPhotocast: Version: 7.0 - SDK 10.8
      JavaAppletPlugin: Version: Java 7 Update 71 Check version
    User internet Plug-ins: ℹ️
      BlueStacks Install Detector: Version: Unknown
    Safari Extensions: ℹ️
      AdBlock
      ClickToFlash
      Awesome Screenshot
      Breaking News
      The New York Times
    3rd Party Preference Panes: ℹ️
      Flash Player  [Support]
      Java  [Support]
    Time Machine: ℹ️
      Skip System Files: NO
      Mobile backups: ON
      Auto backup: YES
      Volumes being backed up:
      Arupreet: Disk size: 499.25 GB Disk used: 357.24 GB
      Destinations:
      CHIKKI [Local]
      Total size: 331.41 GB
      Total number of backups: 2
      Oldest backup: 2014-06-10 13:36:00 +0000
      Last backup: 2014-09-08 13:57:40 +0000
      Size of backup disk: Too small
      Backup size 331.41 GB < (Disk used 357.24 GB X 3)
    Top Processes by CPU: ℹ️
          8% python
          3% WindowServer
          3% uTorrent
          2% SystemUIServer
          0% mtmfs
    Top Processes by Memory: ℹ️
      1.29 GB JavaAppLauncher
      123 MB SystemUIServer
      102 MB iStatMenusDaemon
      86 MB com.apple.WebKit.WebContent
      81 MB WindowServer
    Virtual Memory Information: ℹ️
      50 MB Free RAM
      1.97 GB Active RAM
      1.90 GB Inactive RAM
      673 MB Wired RAM
      6.70 GB Page-ins
      8 MB Page-outs
    Diagnostics Information: ℹ️
      Dec 10, 2014, 10:48:11 AM Self test - passed
      Dec 9, 2014, 02:54:15 AM VLC_2014-12-09-025415_Arus-MacBook-Pro.crash

    Not sure if using Terminal would help:
    Launch Activity Monitor
    Select Memory tab
    Launch Terminal
    type sudo purge
    password
    10-15 sec later Terminal should refresh and show freed memory & cache

  • P7N SLI Platinum Unstable with over 2GB ram and/or dual channel memory on.

    Hello need some help or to report something to MSI regarding blue screens, freezes when booting Vista 64 (SP1 + all fixes installed) with more then 2GB ram.  Single channel mode works (either 1 stick of 2 GB or 3 sticks of 2GB) and is rock stable.  Booting with 2 x 2 or 4 x 2 yields instability and blue screens. 
    I read over Microsoft's hotfix KB929777 however it appears this patch was applied during SP1. http://support.microsoft.com/kb/929777 - when I attempted to apply this hotfix I got the message this update does not apply to your system.
    Memory tested in other gaming system using 4 sticks of G.Skill 1066 DDR2 ram and still have the same issues.  Other forums like Evga.com, Tom's hardware and 411overkill.com tend to suggest some problem with this new bios version 2.0, written by Nvidia.  Some others mention possibly an Nvidia nforce driver issue. 
    Therefore, under duress during testing - with 1 stick or 3 sticks of ram, all tests perfect and passes all stability tests, good marks in Sandra, plays any game.  With 2 or 4 sticks of ram, very unstable won't stay up but for seconds. 
    Any ideas?  (Tested 7 ways until Sunday!)
    My other rig, rocks solid and stable with Vista 64....  It's the Evga new mainboard 780i with triple SLI (132-CK-NF78-A1), 8gb of Gskill 1066ddr2, MSI 8800GT (x2 sli mode) Q6600 @ 3.2 ghz - Raid 0 on dual WD caviar 640 gb/sata 3.0gb/sec.  Seasonic 700w p/s.  8gb of memory and not a hiccup.  Ram 2.0 volts, cpu @ 1.36v.  Will handle the memory from both systems with out fault. 
    Considering I can swap memory back and forth and confirm it's not the sticks, swap graphics boards (own 3 of them!) and rule out that....
    Fyi.  Any help is appreciated! 

    Dump question, but have you pickup the correct update e.g. for 64bit? ==> http://www.microsoft.com/downloads/details.aspx?FamilyId=91672C7C-614B-404C-850C-377541E93C18&displaylang=en
    "This comes inside SP1 for vista 64, as noted with my other system during the build. "
    Better double check it.
    Install all four memory sticks and do a memory check with >>Memtest86<< 1st, ensure that no error(s) will comes during testing.
    Also how about that?:
    Quote from: BOSSKILLER on 07-April-08, 23:55:36
    Remove your OC then see how its goes.
    "When the system boots in single channel mode (only 2 or 6gb of ram meaning 1 or 3 sticks installed into the 4 slots) its' rock stable.  When it boots into dual channel mode (2 x 2 sticks or 2 x 4 sticks) extemely unstable. "
    That means, timings are too tight, or they need a bit more vcore help, or some of the memory stick has failure.
    "MSI P7N SLI Platinum - MS-7380 - Bios 2.0 on Vista Ultimate 64-bit - all updated."
    That BIOS is not for your board, you should use 1.xx

  • I have 2 iphones syncing on one computer and on the same apple ID. Before i updatad my Itunes to the last available update and my Iphones to 5.01 i had no problem draging jpg. and mp3 files into my iphones DCIM folder (the picture folder that opens when c

    I have 2 iphones syncing on one computer and on the same apple ID.
    Before i updatad my Itunes to the last available update and my Iphones to 5.01
    i had no problem draging jpg. and mp3 files into my iphones DCIM folder (the picture folder that opens
    when conecting to Itunes). Since my updates Itune wont let me drag and drop any files' even pictures that
    were taken with my Iphone on 4.3.3.
    Please help as we have no itunes music in Israel, only apps and i cant copy any of my old music from my computer
    to my iphones.
    If it helps, i am using a pc with 32 bit windows 7.
    Other from the obove Itunes works fine and does sync pictures from my computer to my Iphone from "my pictures" folder.
    Thank you for your time
    Yoni Bliss
    [email protected]

    The title of my initial post is a bit misleading. I already took a chance deleting one of the iPhones, hoping if I deleted the wrong one, I can still reauthorize it (all with the same Apple ID acct, so not subject to 90-day waiting period, right?) The iTunes database just updated itself, and it says I have 4 "devices" "in the Cloud", but 5 "computers" associated w my account. How can I find out what computers are associated? Isn't there a list I can see? I dont have a clue what computers they might be. If I use the  "Deauthorize All" option, is it a pain to add them all back in. I assume I would have to log in from each computer to reauthorize each one. Would I have to be running the newest OS or version of iTunes to reauthorize? I think I have a PowerBook G4 Titanium with an older OS and iTunes. I'd like to keep that authorized, if possible.

  • HT4623 i have installed the beta version of 6.1 a month ago and now i cannot open my iphone 5 it needs regestration and when i try to register it says that it couldnt complete and i need to register in the developer what can i do now to reopen my device?

    I have installed the beta version of 6.1 a month ago and now i cannot open my iphone 5 it needs regestration and when i try to register it says that it couldnt complete and i need to register in the developer what can i do now to reopen my device?

    Probably wasn't a good idea to install beta software on a device when you're not a developer.
    Apple clearly states that beta software is not to be installed on production devices.
    Not really much you can do except wait for iOS 6.1 to be officially released and then install it.

  • Iphone contacts "not available" to car phonebook after messing around with Outlook.pst file names and backups. Iphone4 connects to car though and other phones connect properly.

    iphone contacts "not available" to car phonebook after messing around with Outlook.pst files, names and backups, on my ms XP 2003 laptop. I substituted a much smaller new Personal Folder -Contacts File, with a smaller list of phone numbers (4 only as a test) which successfully synced to the iPhone 4. The iPhone connects to the Skoda Octavia HandsFreeSystem OK (Bluetooth works fine), but now iPhone wont load the new Contacts as it did originally. However a family Nokia (never messed with) can connect properly. So must be the iPhone or more likely an Outlook.pst \ Contacts problem. Ideas?

    After fiddling a little more, the following fixed my corrupted outlook.pst file:
    1) I made a backup
    2) In outlook under file, I exported the calendar to excel
    3) In outlook under file, I imported the calendar back to outlook
    And voila, it worked.

  • I am using my iPhone 5 to take pictures and have started a blog with pictures. I am not able to do the update on my phone due to lack of memory.

    I am using my iPhone 5 to take pictures and have started a blog with pictures. I am not able to do the update on my phone due to lack of memory. I wanted to know how much difference this will make to my pictures.
    If anyone had suggestions on how to maximize picture quality n use without the update, I'd appreciate it
    <Link Edited By Host>

    If the lack of space on your phone is due to pictures, you may want to consider transferring some (or all) to a computer and deleting them from the phone. That is a good practice even if you have space on the phone. Instructions: http://support.apple.com/kb/ht4083

  • I can't select icloud backup on my iphone 5, i've got 4.5 gig of available storage and this just started 2 weeks ago

    I can't select icloud backup on my iphone 5, i've got 4.5 gig of available storage and this just started 2 weeks ago, I've tried deleting a couple of apps, signing out, rebooting, all to no avail.  The button stays grayed out and will not let me select.  Any ideas on how to solve this?

    Greetings vahbear,
    After reviewing your post, it sounds like you are having trouble backing up to iCloud. I would recommend that you read these articles, they may be helpful in troubleshooting your issue.
    Get help backing up your device in iCloud - Apple Support
    iCloud Backup alert messages - Apple Support
    Thanks for using Apple Support Communities.
    Take care,
    Mario

Maybe you are looking for

  • Where can I find information about internals?

    Can any one recommend a book or somthing, short of learning C, where I can learn Solaris Memory structures and really understand what they mean. For example, I have never really heard a good explanation of LWP.

  • Refund purchase from itunes

    I purchased something twice and need a refund on at least one of the purchase. How can I get this done?

  • How much "power" does iMovie 09 need to run good, ie CPU & memory

    Hi I have a 20-inch iMac (MA876LL), Mid 2007 iMac, it has a 2GHz. it came with 1Gb, but I upgraded to an extra 1Gb, so have a total of 2Gb in my iMac now. I know about minimum specifications required for software, which I never really take much notic

  • Safari is slowed down with CGContextClipToRect: invalid context errors

    Recently a new circle of **** has opened for me.  Whenever I launch Safari, it stutters along with frequent beach ball stalls.  Checking the Console log, I see a continuous stream of the following:  5/10/12 9:53:20.397 AM Safari[4611]: CGContextClipT

  • Swing Patterns

    Any recommendations for a good source of how to develop large, complex Swing based applications? All the Swing tutorial/books seem to have examples that contain just a few text fields and buttons. I'm looking for something that has tabs, lists, dozen