Optimum swap file size?

Desperado

macrumors newbie
Original poster
May 10, 2005
17
0
Hello folks

Since my Safari tends to show me the spinning ball very often recently I asked myself if I could somehow optimize the way MacOsX assigns memory.

As far as I know the system creates swap files with ~80 MB in size if necessary. My question is if there is an optimum allocation size for people with 1.25 GB Ram.


Thanks for your admittance
 

ManifoldSky

macrumors newbie
Jun 15, 2009
12
1
Umm, what on earth are you talking about?!?

Normally I wouldn't kick such a long-dead horse, but this subject really gets under my skin.
OS X does a very good job of managing the swap file and RAM by itself.
?!?
Although OS X is great at any number of things, VM management is most certainly NOT one of them. OS X has always had crappy VM management, and that has not changed in Leopard.
In particular, OS X's routines for freeing up swap files is atrocious, and forces otherwise unnecessary reboots on a regular basis if you happen to use apps that need huge amounts of memory resources. Upon quit, OS X will SOMETIMES release SOME of the swap memory, but mostly tends to just hold on to it. No amount of quitting apps can rectify this. I can run a particular app, say kJams, that needs huge amounts of memory, and then quit it, and every other app I am running, let the machine sit for 24 hours, and I will still have 8 swap files. This is NOT due to bad system configuration. The same thing happens on several machines, on machines with clean installs, with 4 GB of RAM, etc..
Again, VM management in OS X is NOT something to brag about.
 

portent

macrumors 6502a
Feb 17, 2004
623
2
Normally I wouldn't kick such a long-dead horse, but this subject really gets under my skin.
?!?
Although OS X is great at any number of things, VM management is most certainly NOT one of them. OS X has always had crappy VM management, and that has not changed in Leopard.
In particular, OS X's routines for freeing up swap files is atrocious, and forces otherwise unnecessary reboots on a regular basis if you happen to use apps that need huge amounts of memory resources. Upon quit, OS X will SOMETIMES release SOME of the swap memory, but mostly tends to just hold on to it. No amount of quitting apps can rectify this. I can run a particular app, say kJams, that needs huge amounts of memory, and then quit it, and every other app I am running, let the machine sit for 24 hours, and I will still have 8 swap files. This is NOT due to bad system configuration. The same thing happens on several machines, on machines with clean installs, with 4 GB of RAM, etc..
Again, VM management in OS X is NOT something to brag about.
I'm pretty sure OS X's virtual memory is optimized for performance, not for efficiency.

Think about it. You launch a big program. OS X hangs while it prepares a new swap file. You quit that program. OS X hangs while it consolidates and frees up the swap file. You launch another big program. OS X hangs while it prepares a new swap file. Repeat.

A better approach (from a speed, not efficiency) perspective is to just leave the swapfile in a ready state, since [so the logic goes] if you've needed that much space before, you'll probably need it again soon.