PDA

View Full Version : SWAP Partions for OSX


mmcneil
Jan 26, 2002, 03:00 PM
I suggested this in another forum and was asked to detail the process. I have three PDF documents that detail the actual steps, however I cannot upload those types of documents. If anyone wants copies, I will forward them directly. I followed Andy Moraitis procedures, many thanks to him for blazing the trail. You can get two of the documents at Andy's web site. The third details all the steps necessary to configure a new TiBook.

http://homepage.mac.com/andymoraitis
OSX Swap Information and More

The process involves initializing your disk, so the first step is backing up EVERYTHING, preferably to another disk drive. There are two possible configurations: 1 disk drive or 2 disk drives. I am on a powerbook so the 1 disk drive is what I used. The 2 disk drive configuration is more desirable.

1 Disk Drive
1) Backup drive to be partitioned
2) Boot from another drive or CD in OS9 - this is important because OS X drive utility will not initialize a drive smaller than 2 GB
3) Start Drive setup from the boot drive or CD
4) Initialize the drive with 2 partitions - you select partitions after you select the drive and click initialize, I believe the button is called OPTIONS or CUSTOMIZE.
a) Partition 1 should be between 500 and 1 GB, this will be the swap partition. The PDF recommends 500, I did that and with 320M installed RAM have run up against the limit a couple of times running VPC. This is not a fatal error, you just have to quit a few applications :). Selecting the size of the partition is a little counterintuitive. The more RAM you have, the less swap space you probably need, see the discussion below. It also depends upon which applications you use. VPC is a REAL hog. In configuring new TiBooks (512M RAM) for the office I have elected to use a 1 GB swap out of a 30 GB HD.
b) Partition 2 should be the rest of the hard drive - I prefer 1 partition for OS9 and OSX together. There are a lot of philosphies out there, and I have changed my over time, this is pretty much a personal choice.
5) Reinstall OS9
6) Reinstall OSX
7) Boot OSX
8) Follow the instructions in the attached PDFs

The only difference in 2 Drives is that you put the swap partition on the drive that OSX is NOT installed on. Thus when OSX is booted, it can access the other disk drive while still accessing systems files in parallel. Actually, I do use this option with my PB since I have purchased an expansion bay drive :)

I just configured 3 TiBooks for folks at my office [I'm in line a little later :)]. The whole process took less than 2.5 hours, partly because I am on a cable modem for download. The third PDF document describes the process I used.

You should see a 10-20% improvement in speed, the more apps you use the more improvement because you only really use VM then. You should understand how OSX VM works, it really is the best system I have seen (compared to standard Unix and OS9).

OSX VM automatically and dynamically allocates file space for VM. At startup it allocates ONE 80M swapfile. It ONLY allocates additional space when it exceeds available swap and physical memory. In standard unix, you must allocate all swap space manually and if you run out of swap space tooo bad (actually it is possible to add swap on some flavors of unix manually while the system is running). On OS9, you set it before hand and the system allocates that size block on your HD, it is constantly using that space which is why OS9 runs faster with VM off and enough RAM :).

Good Luck!!

Beej
Jan 26, 2002, 04:53 PM
I have 2 HDs, a 20 GB @ 5400 and an 80 GB @ 7200.

I spent quite a while testing to see where the swap partition worked best, and found that the best setup was with X on the 80, and the swap on the 20.

It gave about a 15% increase in performance all round.

And then OS X 10.1 came out. I haven't tried it, but I can't imagine the procedure produces anywhere near a 15% gain anymore.

Ah well, it was brilliant right up until 10.1 came out. And Andy was very helpful with, and interested in what I was doing.

dantec
Jan 26, 2002, 05:23 PM
No increase on my iBook though... Macs with slow drive pay a penalty with VM & "swapping" files of VM.

I have a question... if some "older" macs have tons of ram, why isn't Apple letting us turn off vitual memory? I remember those days of 9... :rolleyes: Is their a utility to make OS 10 run without VM??

Choppaface
Jan 26, 2002, 06:57 PM
does it automatically turn on vm, or is vm off if you have enough physical ram? cuz I have a gig of ram so it shouldnt be using vm unless somehow I open most of the stuff on my computer

mmcneil
Jan 26, 2002, 08:16 PM
Originally posted by dantec
No increase on my iBook though... Macs with slow drive pay a penalty with VM & "swapping" files of VM.

I have a question... if some "older" macs have tons of ram, why isn't Apple letting us turn off vitual memory? I remember those days of 9... :rolleyes: Is their a utility to make OS 10 run without VM??

If you have a ton of ram VM is essentially disabled, it is only used when the machine runs out of physical memory. There isn't any utility that I know of and I wouldn't trust one anyway. I think the VM on OS X is as good as it gets :)

mmcneil
Jan 26, 2002, 08:31 PM
Originally posted by Choppaface
does it automatically turn on vm, or is vm off if you have enough physical ram? cuz I have a gig of ram so it shouldnt be using vm unless somehow I open most of the stuff on my computer

VM is always on and the machine will set up that initial 80M file at boot. It seems to use a lot of memory during boot, but then settles right down. By the way you can tell how much swap space you are using in a couple of ways.

1) In a terminal window - command line stuff :)

ls /private/var/vm

The number of files you see will tell you how much swap space the system has initialized. These files are blown away each time you reboot.

-rw------T 1 root wheel 80000000 Jan 26 12:07:02 2002 /Volumes/Swap/vm/swapfile0

In the example above, one swapfile - this is good :)

2) Again in a terminal window

top -s 5

you will see something like this

5788(5788) pageins, 1555(1555) pageouts

This is the total number of pageins and pageouts since boot, wait 5 seconds and it will update, and you will get something like this.

5792(0) pageins, 1555(0) pageouts

This indicates that there have been no pageins or pageouts in the last 5 seconds.

There is also a utility you can run called vm_stat from the command line. If you want to know more about these utilities (e.g. top, vm_stat), you can do the following on a command line (man stands for manual page as in documentation):

man top

dantec
Jan 27, 2002, 05:03 AM
yeah... use top and you will see that even with 512 megs of ram OS 10 can still somehow wind up with a gig of Ram!

Here on my iBook right now... top says i am using 2.09 gigs of VM!!! I have 192 ram on my iBook but doesn't anyone else think this is a little exaggerated?

Im running Limewire, Mail, IE & Terminal... How does wind up getting 2 gigs of VM...

eyelikeart
Jan 27, 2002, 04:21 PM
I was thinking about swapping partitions and making my 20 gig X & my 10 gig 9....

I'll have to put all of this to use if I do.... :p