nav_m_osx_lion_server

Mavericks: Your System has Run out of Application memory

by

A few days ago I noticed that my Mac Mini locked up and became unresponsive. So I power-cycled it but didn’t want to spend a lot of time investigating what the problem was. Today it locked up again and fortunately I had an Apple Remote Desktop session open at the time.

Your System has Run out of Application memory
Apple Remote Desktop session

To my surprise OS X claimed that it ran out of application memory. My Mac Mini has 16GB of memory and there aren’t any resource hungry tasks running on the Mini. I thought about what changes I had made to the Mini in the past couple of days and came up with two potential culprits:

  • I re-installed OS X 10.9 (since the official release has a slightly higher build number than the GM I had installed)
  • I upgraded OS X Server from a 2.x Beta to 3.0 GM

To see what exact process was eating up my memory I recycled the Mini, opened up Activity Monitor and let it just sit there. When I returned a few hours later I noticed that a process called “devicemgrd” was hogging memory.



Your System has Run out of Application memory
Devicemgrd hogging memory
It's also using significant CPU cycles
It’s also using significant CPU cycles

I googled to see if I was the only one having this issue and sure enough I came across a thread in the Apple Support Forum addressing this very same problem. One of the users pointed to the “Profile Manager” as being the cause of the problem. To prevent the system from running out of memory completely I killed the offending process and memory usage returned to normal levels immediately. You can see the immediate drop in “Memory Pressure” in the Activity Monitor.

Your System has Run out of Application memory
Normal resource levels

A search on the command line for “devicemgrd” revealed that it’s indeed part of the OS X Server App I just upgraded.

Your System has Run out of Application memory
Find the devicemgrd executable

 

I guess I’ll do some cleanup tomorrow and re-install the application. If that doesn’t work I’ll call my friends at Apple Support again.

Update

Devicemgrd kept restarting automatically so I looked in /var/log/devicemgr/devicemgrd.log and noticed that there was an issue with the underlying Postgres database filling up said log file.

Your System has Run out of Application memory
devicemgrd.log filling up

So I called Apple Support and an enterprise advisor had me run a couple of command in the terminal.

sh-3.2# serveradmin fullstatus devicemgr

devicemgr:state = “STOPPED”

sh-3.2# serveradmin fullstatus postgres_server

postgres_server:error = “FILE_NOT_FOUND_ERR”

Next we ran the following SQL command, which effectively stopped the resource starvation and memory build up:

sudo -u _devicemgr /Applications/Server.app/Contents/ServerRoot/usr/bin/psql -d devicemgr_v2m0 -h /Library/Server/ProfileManager/Config/var/PostgreSQL -c “DELETE FROM db_notifications WHERE message LIKE ‘[DMDevicemgrd updateAllProfilesForID:%’;”

As soon as we executed the above command memory pressure went down. However devicemgrd still consumed over 100% of CPU cycles. So I restarted the Mini and voilà, devicemgrd was behaving correctly.

After I got off the phone with Apple I ran the “serveradmin fullstatus postgres_server” command again and it was still showing “FILE_NOT_FOUND_ERR“. So there is still something not quite right, but at least the rest of the system is running normal now.

Update 2

On November 11th Apple released an update for OS X Server fixing “various Profile Manager migration issues” 🙂

Update 3

Despite the reason updates to OS X 10.9 Mavericks, there appear to be still plenty of users having this issue as indicated by the amount of new posts at https://discussions.apple.com/message/23570014#23570014. On my Mac Mini I have not seen this issue reoccurring since the fix described above. On my MacBook Pro with Retina display I have not seen this issue at all and I restored a Time Machine backup when I got the machine. I’d highly recommend to do a clean install without migrating or restoring anything but actual user data (documents, pictures, videos…). So no settings, profiles or anything of that nature. I bet if you do that you won’t have that issue.

Update 4

I have several machines running OS X 10.1o Yosemite and never saw this issue occur. So I’d highly recommend upgrading.

27 Responses to "Mavericks: Your System has Run out of Application memory"
  1. Hello,
    I tried this command myself. It only deleted two records for me, but your article did lead me to “Profile Manager” and devicemgrd.log files. My log files were up to 27 Gigabytes in size! Some process of stopping “profile manager”, stopping “device mgr”, stopping Web services, cleaning out huge devicemgrd.log files, my problem went away??? I had an error being written every 2 one-hundredths of a second!
    ========
    0:: [173] [2013/10/31 13:20:23.669] Caught exception sending objc_msgsend-style notification [channel: ‘objc_send’, message: ‘[DMDevicemgrd updateAllProfilesForID:65]’]. -[PGDatabaseNotification sendToPayloadTargetInTransaction] (/SourceCache/RemoteDeviceManagement/RemoteDeviceManagement-848.17/Compiled/Framework-Models/Postgres/PGDatabaseNotification.m:150): “‘((m = class_getInstanceMethod(t, s)))’ is NULL”
    0:: [173] [2013/10/31 13:20:23.670] EXCEPTION: NullPtr
    0:: [173] [2013/10/31 13:20:23.670] EXCEPTION: NullPtr
    ======
    over and over. But after all the steps above, I am now running Profile Manager, web server, etc again. No more exceptions, devicemgrd is maintaining approx. 57 MB usage. Log files are no longer logging the above exception.

    No idea!

  2. Okay, I am not a mac expert, but I have the “system out of memory” after downloading and installing Maverick. What can a non-techie do to solve this problem? I vaguely understand what you guys are talking about, but I am not confident enough to go in and delete files. I don’t actually know what it means to “kill” a process that I see hogging memory in the Activity Monitor. Have any plain English suggestions for how to fix the problem? I could sure use some help so I don’t have to resort to holding down the power key over-and-over again to get out of the frozen desktop and start over again.
    Thanks,
    P

    • Hi Patrick,

      Since you probably don’t even have OS X Server installed I don’t think the solution in my post applies. Instead it appears like there is a general issue in Mavericks in combination with certain apps. Most likely caused by something going wrong during the upgrade.

      I’d recommend calling AppleCare, but be warned, they’ll probably have you reinstall the OS. So backup all your data before you call.

      Cheers
      Michael

    • Did you find any easy solutions Patrick? I’m also a non-techie and having the same “system out of memory” problems after installing Mavericks and it seems after months of Apple’s customers having these upgrade problems they would have an easy solution figured out by now.

    • I had this problem and where I was getting the error your system has run out of application memory and fixed it by resetting the NVRAM /PRAM.
      TURN OFF COMPUTER
      Turn on computer and
      HIT COMMAND / OPTION / P / R ALL FOUR KEYS at the same time before the gray screen appears
      Hold the keys until you hear it start up for a second time.

      I had to do it twice, one right after the other, and now my machine is fine.

      Hope this helps

      Check this link: http://www.mac-forums.com/switcher-hangout/320883-run-application-memory.html

  3. Thank you very much, my problem is resolved with your advice. But I use this command which is a bit different than yours : sudo -u _devicemgr /Applications/Server.app/Contents/ServerRoot/usr/bin/psql -d devicemgr_v2m0 -h /Library/Server/ProfileManager/Config/var/PostgreSQL -c “DELETE FROM db_notifications WHERE message LIKE “‘%updateAllProfilesForID:%’;”
    I’ve got in return : DELETE 4
    After restart my mac mini, everything is OK … no more devicemgr in memory tasks

    Thank you a lot.

  4. In my case the culprit was Address Book / Contacts running out of control.
    I suspect incontinent syncing: looping repeat entries from iCloud.
    Switched off Contacts in iCloud prefs and threw out all the Prefs and the App Support folder for Address Book and the problem was solved.
    Though I had replaced the 4GB Ram in the MPB with the max 8GB by then anyway…..

  5. Just to help rule out theories:

    I am having this problem on my NEW MacBook Pro Retina.

    It had Mavericks from the factory, so no upgrades.

    It doesn’t have Server installed.

    I don’t use iCal, and I don’t use Contacts.

    I don’t use iCloud.

    The problem is still happening.

      • I actually take back my comment. I now believe my issue may be unrelated, because I identified a specific third-party app that may have been causing the issue by leaking 9+ gigs of RAM during the night. (Closing that app caused my swapfile size to drop from 10 gigs to 1.)

          • In my case it was an app called ‘Narrative Uploader’, which is the software component of an obscure crowdfunded hardware device that nobody here has.

            It did not seem to be to be important to name the app, since there are a billion third-party apps that overuse RAM, and given that there’s a common thread here with many people having the same problem, it’s extremely unlikely that I was seeing the same problem as the people here (given how few people will have this specific obscure app.)

      • Yes! Infact it seem to have more often but it does recover by slowly still not leaving you with enough memory to recover fully to the system max performance level. Meaning, you get more rainbow colored spinning beach balls.

      • Yes! In fact it seems to happen more often but it does recover by slowly still not leaving you with enough memory to recover fully to the system max performance level. Meaning, you get more rainbow colored spinning beach balls.

  6. This lady has this problem on her MacbookPro since a month. First I could not start my whole Mac anymore. Then after I googled how to start up in a supporting mode I had to add a whole new partition on my Mac. Pffff. Well now I have 2 partitions (waste of my disk) but fortunately still could start up again and still have all my files and software. But now (and I have nothing more then before I ran Maverick) I have lots of memory left, it says I have not enough program memory. It sucks cause I can hardly work like this. I did not go to the shop because I think I can solve this problem myself. Anybody solved this kind of problem ? I made a backup of my files but hope not to have to loose all my software.

  7. OOps I doubled posted! But I have reinstalled Mavericks several times now due to freezing, crashes or the application would not load up; Garage Band, iMovie, iPhoto and iTunes. So 10.9.2 may have solved some issues but not all. It seems to have created all new ones! The listed few that randomly failed has lead to performance issues after restarting. Which lead to me trying to repair permission that would not repair.

  8. I have a mac pro 2008 and upgraded from snow to mavericks
    Within five – ten minutes it ran out of memory
    Activity monitor showed memory was eaten by pdftopdf
    Culpit: hp printer software
    Solution: uninstall hp and reinstall software and drivers
    Cost: a day headaches

  9. I have Maverick 10.10.2 with “Not enough memory ” message and is working extremely slow even after Apple Care has done something almost three times since I bought this Mac Mini on April 2014. I am not an computer tech, so I always call AppleCare but it seem that they do not know how to solve the problem or just doing a quick fix. I am getting frustrated with Apple’s machines and services !

  10. Please continue the detective work! This problem has been bugging me on the latest iMac and Mavericks (10.10.2) version.

    You are our only hope 🙂

    • Have you don’t an install from scratch without restoring any Time Machine backup? I have done several Yosemite install in the meantime and never had this issue again on either my rMBP or Mini.

      • I will give this a shot. The problem only happens once every few weeks, usually after returning to my system after a long break with many apps open. I’m wondering if it’s worth a complete reinstall / reconfigure.

        Thanks again for the advice and your hard work on this issue!

  11. I had this problem on my 2012 iMac with 8GB RAM and it turned out to be one particular tab I had open in Safari.

    Found it by looking for the infamous devicemgrd thing, but I didn’t have it running – or OSX Server in fact! Instead I saw Safari Web Content hogging about 5.99GB of RAM. I had about a dozen tabs open but it’s never been a problem with double that open before. Closed them one by one, turned out to be a photographer’s really badly coded flash website.

Leave a Reply

Your email address will not be published. Required fields are marked *


Share This