: Mac OS X and virtual memory


Noodleboy
Jan 26th, 2004, 06:37 PM
Could anyone tell me if there's a way to adjust/change the amount of virtual memory that OS X uses? Our studio would like to optimize the system for rendering and the issue of virtual memory came up. I haven't heard much about this and was wondering if it's possible.

Thanks.

Noodleboy.

Terry O'Leary
Jan 26th, 2004, 06:53 PM
OS Xs virtual memory is always on. It is a much better than OS 9s (and earlier). The main thing you can do is to make sure your swap files are on a different disk than the files your application is using.

Implicitely your swap files are on your boot up disk. You can change this but you had better know what you are doing.

For most people lets suppose you are running an application with a source file and a destination file. On a 3 disk Mac your bootup disk is disk "A", your source disk is disk "B" and your destination disk is disk "C". This should keep any ill effects of virtual memory to a minimum.

You can also close unneeded applications.

- Terry

gordguide
Jan 26th, 2004, 10:28 PM
Apple's VM uses roughly 80MB per "page". If you have enough RAM it will create one page, but never really use it.

If you don't have enough memory, it will create a number of pages (as needed, depends on installed RAM how many), each 80MB (reserved) in size. As I understand it, with a minimal amount of RAM installed you generally find about 7 pages created (about 560MB total).

PageOuts (collecting and saving data from memory to make room for another application to use that memory space) take time; PageIn's don't really (it's just reading off the disk).

If you have enough RAM you will find one VM file, 80 MB or so in size. If you check processes while running your standard application set you will most likely find it lists pageouts and pageins as zero. In other words, it creates the VM file on starup but does not use it.

Moving the VM file to another separate partition can help, but the short answer is if you have enough RAM, don't bother and don't worry.

To check exactly were your installation is, do this:
Launch Terminal.app
At the prompt type:
top
then hit return.

On the last part of a 4 or 5 line text report at the top you will see something like:

Processes [...] 107248(0) pageins, 2(0) pageouts

PID command [...]

The key here is the figures in brackets which show current VM status; this is from my machine as running right now. The other figures are since launch; quite a few pageins (no real performance hit) and two pageouts (can slow things down).

In this case, I have adequate RAM (1.5GB) but in all likelyhood the pageins/pageouts were related to my launch today, where I started up Software Update, launched mail and Safari, all at the same time. Software update ran today's Security Update while I continued working; I still haven't restarted to finish the installation. Normally I see no pageouts at all.

Quit the terminal and relax, or add RAM if necessary.

[ January 26, 2004, 09:59 PM: Message edited by: gordguide ]

Noodleboy
Jan 29th, 2004, 02:07 PM
Hey everyone,

Thanks for the tips. I figured more RAM and partitioning the drive would probably help.
I checked "top" in terminal, and the amount of pageouts is astronomical (1,186,612)!! Yikes!

Noodleboy.

Bertrand (Fr)
Jan 29th, 2004, 04:49 PM
Hi, Noodleboy,

Try to keep more than 10% of free space on your system disk, this helps.

[ January 29, 2004, 03:59 PM: Message edited by: Bertrand (Fr) ]

Noodleboy
Jan 30th, 2004, 12:10 PM
Hey Bertrand,

Yep, thanks for that tip. We've got 50% free; but the drive is not partitioned. When our production wraps, I will reformat and partition the drives.

Thanks!

Noodleboy.