MacOS – way to reduce the swappiness of OS X 10.6 Snow Leopard

macosvirtual-memory

I have 6GB on my old Macbook, with an SSD. I would like to avoid writing to the swap file as much as possible. Ever since my upgrade, I have always had at least 1 to 1.5GB memory "free". Yet, I have always had 2 to 25MB of used swap space. (Out of 128MB total) How do I get this to be 0MB swap used unless I run out of "free" memory?

On Linux, there is now a "swappiness" parameter that controls the tendency to use swap. I'd like to crank OS X's "swappiness" down very very low, but not deactivate swap entirely. I'd like to know that my machine will just run slower if it ever runs out of memory instead of having a kernel panic. I'm pretty close to where I want to be, but I'd like to get rid of these writes to a large file that (slightly) shorten the life of my SSD while doing me no benefit whatsoever.

Best Answer

I'm not sure that a swap file of 2MB to 25MB is really something to worry about. It might be more useful to look at the values for Page In and Page Out to determine how often data is being written to the swap. The number of page events can be found using the System Memory tab of the Activity Monitor application.

There are a couple of other options that you could try but I think you're probably way out of warranty if you try:

I would just suggest putting up with the existing system since the wear on your SSD is probably minimal especially since SSD wear is a bit of a myth anyway or maybe it's not.