Swappiness

Discussion in 'Mac Basics and Help' started by killfoot, Jan 7, 2009.

  1. killfoot macrumors newbie

    Joined:
    Dec 6, 2008
    #1
    Is there an equivalent to linux's swappiness? In case it doesn't go by the same name:

    http://www.linode.com/wiki/index.php/Swappiness

    It seems like my macbook swaps out pretty early. I can be using 55% of my memory (1GB) and still have 150mb swapped out. It bothers me, and I'd really like to change it, but I've searched everywhere to no avail :(
     
  2. BlueRevolution macrumors 603

    BlueRevolution

    Joined:
    Jul 26, 2004
    Location:
    Montreal, QC
    #2
    Beats me. This is already the first Google hit for "mac swappiness". :cool:

    I did find / -name swappiness on my Mac but nothing came up. It sounds like a neat feature, though, so be sure to keep us posted if you do find something. And future Googlers will thank you, too. ;)
     
  3. zorinlynx macrumors 601

    zorinlynx

    Joined:
    May 31, 2007
    Location:
    Florida, USA
    #3
    I am also seeking a similar tweak.

    It seems Mac OS X is very liberal about swapping running applications out to disk during heavy file I/O. I started a large (8GB or so) copy to this iMac which has 1GB of RAM, and when I returned, pretty much every running application had been needlessly paged out.

    This is worse when doing a lot of file I/O while you are working; the OS will swap out apps and the system will become sluggish.

    Sure, one answer might be "get more memory", which does solve the problem, but the system doesn't truly need more RAM. If you completely disable swapping, you can perform the same operations and the system runs beautifully. Of course this is a bad idea, because if you DO use up too much RAM with applications, the system can become unstable and crash.

    So yeah, being able to tweak this would be great. But I can't find any reference to it anywhere online. At least a RAM upgrade for this box is on the way!
     
  4. afatsum macrumors newbie

    Joined:
    Oct 16, 2009
    #4
    re:swappiness

    So this is one of the first results that I saw when I googled "mac os x swappiness" (or something like that).

    A swappiness sort of feature would be awesome, but I don't know how low-level that would go.


    I'm not positive, but I think that the memory manager is contained in the Mach part of the OSX kernel, outside of userland. I have no clear idea if that could pose a problem, but my guess is that it would.


    My mac seems to very aggressively swap out memory. That is (and I may have used the term "aggressively" incorrectly), I have 750 MB of swap space currently being used, but I have 1.29GB of RAM free and 1.27GM of RAM inactive. I understand wanting to keep some memory free for whatever a user may want to do, but it would make more sense to me if there were some sort of moderately-difficult-to-access method of altering what the equivalent of "swappiness" is on the OSX kernel. That way people who would destroy their systems if they altered it wouldn't be able to get to the option (very easily, that is).


    I understand the reasoning behind writing to swap, in terms of user-friendliness for people who don't know anything about their computers, but I would love to be able to change swappiness.


    Also, I know that the iPhone OS doesn't swap out memory because swapping out to a flash drive would destroy the flash drive's lifespan. In contrast, a magnetic hard drive can put up with many more read/writes than a flash drive. Maybe the differences between the OSX kernel and the iPhone kernel could yield some sort of interesting results. However, I'm not sure if Apple offers their kernel open-source (I seriously doubt it, but I'm not positive). On the other hand, I haven't checked out alternative OSX kernels, which may offer that option.


    I'll probably be back to post more about this issue.
     
  5. Siggen macrumors 6502

    Joined:
    Apr 1, 2011
    Location:
    Oslo, Norway
    #5
    Im installing an SSD (without removing my harddrive) on my MacBook Pro. I came from Linux (not from windows) when I migrated to Mac, and I want this tweak now :(

    Kind of makes me scared to install my SSD (when i get the harddrive superdrive caddy). Seeing as I like to have my hardware for a long time :(

    EDIT:
    And yeah, this is still the first result on google for "Mac Swappiness"
     

Share This Page