32GB Memory and Swap Used

Discussion in 'Mac mini' started by MacDaddyPanda, Jan 17, 2019.

  1. MacDaddyPanda macrumors newbie

    MacDaddyPanda

    Joined:
    Dec 28, 2018
    Location:
    USA, CA
    #1
    Can someone explain why the swap is used despite my having 32GB of Memory? Nothing wrong happens otherwise. I'm just curious if someone can tell me why? Screen Shot 2019-01-17 at 21.24.55.png
     
  2. philipma1957 macrumors 603

    philipma1957

    Joined:
    Apr 13, 2010
    Location:
    Howell, New Jersey
    #2
    So it is small swap. Does it grow with time? How much time did it take to get to that number?

    I would worry more if I saw page outs and they grew. Although I am not sure it shows page outs anymore.
     
  3. MacDaddyPanda thread starter macrumors newbie

    MacDaddyPanda

    Joined:
    Dec 28, 2018
    Location:
    USA, CA
    #3
    I haven't seen it grow. Previously it was a smaller swap, but I rebooted since and today I saw it at 60mb. I'm not sure when it took place. I've seen my Ram usage go up to 23GB. That happens if I start using google maps or viewing photos or something graphics intensive. Then when I close the photo viewer or the maps tab the ram will drop back down to 20GB or so. If I reboot it goes to 7-8GB. Then as I leave Chrome windows and tabs open It slowly goes back towards 20GB and stays there usually. Typically I'm just surfing the net or watching Youtube at the same time. Occasionally open photo viewer and few other apps that aren't really GPU intensive. Nothing heavy beyond that. I"m not editing 4K vids or photos or anything like that. So I was surprised to see any swap happening at all.
     
  4. nampramos macrumors 6502

    Joined:
    Dec 14, 2010
    #4
    I have only 8GB RAM and my of 9GB SWAP, 7-8GB of it is normally in use, even when there's free RAM. I do always have heaps of tabs open (21 right now) on Safari and LightRoom running, plus Spotify and WhatsApp.
     
  5. keysofanxiety macrumors G3

    keysofanxiety

    Joined:
    Nov 23, 2011
    #5
    Some critical system apps or functions also page to disk to improve stability IIRC. Same happens for me. It’s normally just a very small swap file.
     
  6. macdos macrumors regular

    macdos

    Joined:
    Oct 15, 2017
    #6
    Sure, thanks for asking.

    It is because Mac OS does not purge cached files before starting to swap to disk, as would be expected (and as is done on Linux). It will just hold on to that cache for as long as it can, even if it is totally useless.
     
  7. dia3olik macrumors member

    Joined:
    Sep 14, 2007
    #7
    wait a sec...what?? Is there a way to prevent this? thanks!!!
     
  8. macdos macrumors regular

    macdos

    Joined:
    Oct 15, 2017
    #8
    sudo purge
     
  9. MacDaddyPanda thread starter macrumors newbie

    MacDaddyPanda

    Joined:
    Dec 28, 2018
    Location:
    USA, CA
    #10
    I tried that, it didn’t seem to do anything when I typed the command. So is this behavior intended? The swapping despite having plenty of memory?
     
  10. macdos macrumors regular

    macdos

    Joined:
    Oct 15, 2017
    #11
    It will clear all cache from memory. The swap remains however, and so do compressed files in memory.

    Who knows what Apple intends? The thing is that it will slow down your computer as soon as it starts to use disk instead of RAM, no matter how fast the disk is.
     
  11. chabig macrumors 603

    Joined:
    Sep 6, 2002
    #12
    It's not your job to manage memory. The operating system does that. None of us truly know how exactly it works, nor do we need to. We also don't need to be concerned about it.
     
  12. macdos macrumors regular

    macdos

    Joined:
    Oct 15, 2017
    #13
    Well, you should be concerned when your computer suddenly becomes very slow… that is when it starts using the disk instead of RAM. No other OS behaves like this.
     
  13. Fishrrman macrumors P6

    Fishrrman

    Joined:
    Feb 20, 2009
    #14
    If you have 32gb of installed RAM, and you don't "push things to the limit", you could TURN OFF VM disk swapping. NO VM "page ins" or "page outs" at all.

    I've done that on a 2012 Mini with only 10gb of RAM.
    It runs fine and never crashes.
     
  14. pl1984 macrumors 68000

    Joined:
    Oct 31, 2017
    #15
    Chabig is correct, don't mess with it unless you know exactly what you are doing. Paging is a normal part of an operating systems functionality and some paging, regardless of memory configuration, is not surprising. 60.3 megabytes of paging activity is nothing to be concerned with.
     
  15. Ploki macrumors 68040

    Joined:
    Jan 21, 2008
    #16
    "some paging" is not normal if you have enough RAM.

    screenshot is with running logic. when i quit logic, cached files dropped for 0.5gb
     

    Attached Files:

  16. MacDaddyPanda thread starter macrumors newbie

    MacDaddyPanda

    Joined:
    Dec 28, 2018
    Location:
    USA, CA
    #17
    Ok thanks for the info everyone. Yeah I wasn't really wanting to mess with memory management since nothing adverse was happening during my computer usage. Further reading I see this is normal behavior for MacOS and I shouldn't be too concerned. I'm coming from Windows. I thought I understood that Swap was only used when physical memory ran low enough to trigger swap. So with 32GB it was surprising. Since the GPU shares the system memory and it allocates specific amount of memory for that purpose is what I'm seeing a result of GPU causing the memory swap?
    I guess on my windows system I never noticed it because I had a dedicated gaming video card. So any swapping on Windows would be unusual barring me using a photoshop type app or some heavy application like cad or something?
     
  17. pl1984 macrumors 68000

    Joined:
    Oct 31, 2017
    #18
    Yes, it is. From my 2010 Mac Pro:

    Screen Shot 2019-01-18 at 9.48.03 AM.png

    Unless you have intimate details of how macOS manages its memory don't worry about a few megabytes worth of paging.
     
  18. NT1440 macrumors G5

    NT1440

    Joined:
    May 18, 2008
    #19
    Well yea, IF it becomes very slow. The OP has made no mention of that, at all, so why bring it up when it's clearly not happening?
     
  19. MacDaddyPanda thread starter macrumors newbie

    MacDaddyPanda

    Joined:
    Dec 28, 2018
    Location:
    USA, CA
    #20
    I only brought it up out of curiosity. No adverse behavior was happening. That's all.
     
  20. Ploki macrumors 68040

    Joined:
    Jan 21, 2008
    #21
    mine never pages unless it runs out of physical RAM.
    In your screenshot I suspect you ran out of RAM at some point or were nearing that moment
     
  21. MacDaddyPanda thread starter macrumors newbie

    MacDaddyPanda

    Joined:
    Dec 28, 2018
    Location:
    USA, CA
    #22
    Yeah it must have, but I'm not 100% sure. As I never saw it reach 30GB or something. Unless the threshold for swapping is lower.
     
  22. pl1984 macrumors 68000

    Joined:
    Oct 31, 2017
    #23
    Paging is common during operating system operation (Windows too) and it is therefore the answer to the question. If you want specifics a much more in depth analysis would be required. An analysis which it's unlikely would ever be possible.
     
  23. FrontierForever macrumors newbie

    FrontierForever

    Joined:
    Nov 10, 2018
    #24
    As an AAPL shareholder, bricking customer's computers sooner can only increase sales. Need to keep the investors happy.
     
  24. Cheapassmac macrumors regular

    Joined:
    Nov 5, 2018
    #25
    I've seen a couple MB of paging even when clearly having enough memory and literally idling. I suspect there's room for improvement in the OS as it shouldn't have paged in theory (but did).

    Luckily, a couple megabytes of paging over a long period of time in a system swimming in gigabytes, it's small enough to not matter too much (in respect to performance and SSD wear and tear).
     

Share This Page