Very high swap usage

Discussion in 'macOS' started by hordur, Apr 14, 2016.

  1. hordur macrumors newbie

    Jun 23, 2010
    I have a late 2013 model 21.5" iMac with 16GB ram running OS X 10.11.4. I'm having this problem that it is consistently allocating up to/close to 32GB of swap. There are not many swap-outs, so I guess this is not having much impact on performance, but it seems like all applications are just allocating memory out of control. This is also causing 32GB of my 250GB SSD to be occupied by some ******** that is never used and I've been getting low disk space warnings. I have not experienced this with my MacBook Pro or previous Macs I had.

    In order to try to remedy the problem (and another one which I'll describe at the end of the post) I set up OS X on a new SSD and did not do any migration from the old drive, but now the problem is back again.

    Looking at Activity Monitor, here are some values from the "Memory" column:
    Photoshop CC: 4.03GB (no file open)
    Dropbox: 4.00GB
    Skype: 3.73GB
    Finder: 3.67GB (single window open)
    Notification Center: 3.57GB
    Dock: 2.97GB
    Google Chrome: 2.95GB
    CrashPlan menu bar: 2.56GB
    loginwindow: 2.51GB
    Lightroom: 2.51GB
    iTerm: 2.50GB (single terminal open)
    Flux: 1.31GB

    I find it especially strange that Notification Center, Dock and loginwindow are allocating so much memory.

    If anyone has some suggestions, explanations or remedies for this problem, they would be greatly appreciated.

    *the other problem I was having was that Adobe Photoshop was always using at least one full CPU core, even when it had no file open.
  2. hordur thread starter macrumors newbie

    Jun 23, 2010
  3. Fishrrman macrumors G5


    Feb 20, 2009
    Here's a suggestion I'll offer.
    Others will tell you NOT to do this.
    I've been running my Mac Mini using this trick for months and months, never a crash.

    DISABLE VM swapping (page ins and page outs).
    Use this terminal command to do it:
    sudo launchctl unload -w /System/Library/LaunchDaemons/

    password and restart required.

    Then, use this command to check that VM is disabled:
    sysctl vm.swapusage
    If VM is off, report should be:
    vm.swapusage: total = 0.00M used = 0.00M free = 0.00M

    To remove the swapfile, use this:
    sudo rm /private/var/vm/swapfile*

    To RE-ENABLE disk swapping, use this:
    sudo launchctl load /System/Library/LaunchDaemons/

    It will hurt nothing.
    If it doesn't work, just re-enable swapping.

    But ... it may give you better performance than you're getting now.

    My opinion only.
    Others will disagree.
    Some will disagree vehemently.
  4. hordur thread starter macrumors newbie

    Jun 23, 2010
  5. Weaselboy Moderator


    Staff Member

    Jan 23, 2005
    Do not bother with the suggestion in post #3. That does not fix the problem, it only masks the problem by disabling the swap file.

    Was there some point in time where this was not occurring? Can you think of any app or utility you may have installed that coincided with when this started?

    Just as a test, try holding the shift key when booting to start in safe mode. That will prevent all startup and launch items from running. If this does not happen in safe mode, then that tells you it is some startup or launch item causing this and we can then try to figure out which item is the problem.
  6. hordur thread starter macrumors newbie

    Jun 23, 2010
    I'm not 100% sure it didn't happen before, but I suspect it didn't as I had never noticed it. No, can't think of any app that could be the culprit and if it was caused by one, I guess I've reduced the set a lot since I set the computer up from scratch again, only installing a subset of what was in there before. I'll try the safe mode and see if it happens there as well.
  7. throAU macrumors 603


    Feb 13, 2012
    Perth, Western Australia
    I'd say google hangouts is probably a contributor to this.

    If your machine is swapping that hard, the root cause is a memory leak from an application.

    Killing swap is not a fix.
  8. chrfr macrumors 604

    Jul 11, 2009
    What do you have in Notifications? That 8GB+ it's using is certainly very abnormal. On my system here it's using 20MB; on another of my computers it's using 46MB. It looks like you have a fairly large number of login/startup items running so I'd try disabling those and testing to see if the memory usage goes down.
    I also agree that disabling swap is of no value and just masks whatever the real problem might be.
  9. Fishrrman macrumors G5


    Feb 20, 2009

    As I said in the second line of my post #3, others will -- and have -- told you not to try my suggestion.

    And I will repeat:
    If nothing else works, give it a try.
    You may be surprised at the results....
  10. Mr. Buzzcut macrumors 65816

    Mr. Buzzcut

    Jul 25, 2011
    He doesn't have enough physical memory. First few apps in the process list need to be looked at.
  11. hordur thread starter macrumors newbie

    Jun 23, 2010
    I have not touched notifications since I reinstalled MacOS so it has no widgets except the default ones and it has a few notifications listed.

    Don't think this is such a large number of startup items:
    - iTunesHelper
    - witchdaemon
    - CrashPlan
    - Alfred 2
    - Dropbox
    - Insync
    - iStatMenus
    + some Adobe creative cloud stuff

    I also had f.lux on that list, but I've disabled it now as it is the first one on my list of suspects. Let's see what happens.
  12. Weaselboy Moderator


    Staff Member

    Jan 23, 2005
    The guy has freakin' Finder using 3.67GB of memory. Something is seriously wrong here and disabling the swap file is not going to fix it.
    --- Post Merged, Apr 16, 2016 ---
    There are several places launch items can be. Not just that login items list in Users & Groups. Try the safe mode boot I suggested just as a test to see if that fixes it. If it does we can start trying to help you figure out which launch item is causing this.

    In addition to the startup items, launch items can also be in these folders.

  13. hordur thread starter macrumors newbie

    Jun 23, 2010
    Ok, f.lux seems to be the culprit. Removed it from startup, rebooted and ran the computer for a few days, no abnormal memory buildup, everything OK. This morning, I run f.lux and check on the computer 9 hours later: 13GB in swap, bunch of applications using it.

    Screenshots of activity monitor right after I started f.lux and then another one 9 hours later: 2016-04-20 08.47.31.png?dl=0 2016-04-20 17.53.41.png?dl=0
  14. cerberusss macrumors 6502a


    Aug 25, 2013
    The Netherlands
    That's indeed a very big difference... Surprising.
  15. throAU macrumors 603


    Feb 13, 2012
    Perth, Western Australia

    I'm an f.lux user here and haven't noticed the swap growing....

    Sounds like perhaps you may have uncovered a driver memory leak or something, i'm on intel HD6100 here, what GPU is in it?
  16. chrfr macrumors 604

    Jul 11, 2009
    You should view the memory usage in Activity Monitor with "all processes" rather than "my processes." This will likely be more helpful in verifying whether or not it's really f.lux by showing you everything that's running.
    All of that swap is not necessarily a performance problem, as long as you aren't getting the out of memory errors. The Memory pressure is still green and there's RAM left to use.

Share This Page