Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacRumors

macrumors bot
Original poster
Apr 12, 2001
65,990
34,797
As most OS X users are probably aware "virtual memory" (or paging, in OS X's case) is always "on," as is the case with any modern operating system. It is an integral part of the kernel's functionality. As a result, every time OS X is booted a swapfile is written to the partition where OS X resides. When many apps are open and free physical RAM becomes scarce, more swapfiles (80MB each) are written to the disk at need. As far as OS's go, OS X has a particularly robust paging system--but it does suffer a speed hit due to OS X's default configuration of writing the swapfiles amidst the files on OS X's partitions. Inevitable file fragmentation forces the swapfile to be written to and read from all over the disk, imposing the seek-time limitations of the disk on OS X's attempt to swiftly page data to and from the disk.
The solution: create a dedicated swap partition (this is the way Linux's swap system is setup by defualt) for OS X to page to (on a separate physical drive, if possible). In searching the web for information dealing with this alteration, I found a number of sites with prodcedures to follow. The one I felt most comfortable using as a guide was setup by Andy Moraitis. In looking at his procedure and through back-and-forth e-mail with Andy, it's clear he has a deep understanding of the mechanisms of OS X and its paging system (and that of its predecessor, NEXTSTEP). And lucky for those with a mind to increase OS X's performance, Andy has recently put out an even more detailed version of his procedure, which you can get from his iDisk. (Note this guide is in Tex-Edit Plus format--download this editor from VersionTracker.)
Truly, if you're even remotely comfortable with using the the OS X Terminal shell, this modification is time well spent.
 
try it

i did this about 2 months ago and it wasn't that hard to do at all... and this is coming from someone who has true Terminal.app phobia!

try it... and as the walk thru i used said 'if you mess it up all that will happen is that it wont work, and your current swapfile will continue to be used'

there you have it... a small speed boost noticed, but nothing revolutionary... i suspect that 10.1 might hold more answers to your hopes as far as far a speed is concerned, but it cant hurt to try! and who knows, you might learn something - i certainly did!
 
Mmmmmm

Well, may be what I'm gonna say show my ignorance in the matter... but, I work with audio in my computer and audio soft does not work with virtual memory on. The problem with audio is that is a continuos piece of data that can not be interrupted at any time when playin from the hard drive.

In the OS X word, how this issue would be resolved if virtual memory is always on? I asume the file managment (to give it a name) would be different but how?
 
That's audio software for the Mac, under Mac OS 8/9, etc. Every modern operating system (MacOS 9 is not a moden operating system from a technical perspective) has virtual memory as a standard part of its operation---without the option of turning it off. The fact that under MacOS 8/9 you can turn off VM is a testament to how terribly it is implemented. The reason your audio software is complaining about VM is that under MacOS 8/9 it is slow and kludgy.

Unix has always had VM, and all of its flavors (Linux, NeXTSTEP, Solaris, QNX, Irix, etc.). With with Windows NT 3.1 (and soon after Windows 95) MS has had VM standard. It cannot be turned off in any of these configs, yet people get work accomplished in the pro audio sector. The answer to how to reduce problems associated w/ VM slowing your system is to add loads of physical RAM. Another is to get a fast SCSI drive system that has a VM partition on a separate drive from your main OS. That's where this article is headed--toward improving throughput by reducing the hit of memory paging.

Mac OS 8/9 has gotten people to thinking about VM as if it were an optional thing. That is a bad thing. A good thing is a machine with a decent amount of RAM and a fast and efficient VM system. And that's what we have with OS X. Thank heavens it's finally here, and OS 8/9 will soon be no more.



blakespot
 
yes yes yes

i agree with blakespot... the sooner OS 8/9 is out of the window and forgotten the better. from a technical point of view audio apps run in OSX run better not to mention a hell of allot more stable... just wait for Logic 5 coming out in the next few months! i cant wait... then all we'll need is a carbonised version of Peak and we'll be away!
 
X Audio = Good

I second--those virtual memory comments are absolutely true, and I only hope that longtime Mac users will start to catch on. I wanted to add that, according to a study published recently (I don't have the link, unfortunately), X actually has the lowest audio-app latency of ANY standard OS--including MS offerings and Linux. That, of course, is a Very Good Thing.
 
Audio on X

Audio on X is going to kick arse. Especially as any app running Core Audio/Core MIDI services ought to be able to shoot audio and MIDI to any other app using those services. So I will FINALLY be able to use Peak and Logic side by side, which will, well, be the ultimate. :)

I also heard that Classic in 10.1 WILL support audio hardware -- if this is true I am going to shoot a load, to put it bluntly. I sure hope so -- I never want to have to boot into 9 again.
 
virtural memory

A correction to blakespots's reply. Virtural memory in windows can be disabled but it its not recomended.
 
Howdy All!

Please note that I have posted a new version of the article to my iDisk in pdf format that no longer requires Tex-Edit Plus. The Tex-Edit files have also been removed since many people don't use the application in the first place.

Also, the FAQ was updated with three new questions.

Comments and feedback are welcome.

Andy

P.S. Any application (including audio programs) will automatically take into account that OSX uses a VM system and will operate within that framework. I don't know how complex this is in terms of kernel tasking and threading, but I'm sure that developers will have it figured out.
 
Pdf won't open

I can't get either of the pdf files on his idisk to open up. All I get is a 100 byte file. Do these files work for any of you?
 
lemon curry

If you ask me (which you didn't), that "positive/negative ratings" system is bunk. Trash it, the ratings never reflect the articles at all in any logical kind of way.
 
i say keep it....

its a good way for people who don't have enough to say on the subject to be heard, and while i gave this one a positive vote, i can see why people would give it a negative...

if you try to look at it from the user point of view... allot of people (most infact) use macs for one reason only... superior design..... ease of use etc... and when it is pointed out by people in the know like Andy Moraitis that OSX was produced with what is effectively a design problem - something that could have been done better like the swapfile placement (especially when it is said to hinder speed!) - they see it as a problem with OSX and not some cunning walkthu devised by Andy...

if you see what i mean...
 
Did text files go out of style or something?

Is it a crime now to post plain text files that ANYONE can download and read? None of thse PDF files will download correctly. They are both over 500k yet when I go to download them in any browser all I get is 100k of useless file.



Here's a tip, there's something in your /Applications folder called "TextEdit". Use that to make files that other OS X users can read.
 
While I am at it........

Also, why didn't the guy just throw up a webpage with the info? Why make people download something just to read? If we wanted to keep it all we would have to do is choose "save" in our web browsers.


 
Stating the Obvious

Dear Moron Administrators,

Perhaps there are so many negative votes for this story because people can't download the ****ING file. Thank you for your time.







Obviously yours,
Mr. Obvious
 
Server Problems

For some reason, either the files are corrupt or there is a problem with Apple's servers. I've been attempting to re-post them in original Tex-Edit Plus format and Stuffit 6.0 format and all attempts to do this have failed when I download them.

I'll probably end up taking the day off to work on the problem and will find some type of solution. While the latest document is the best, the original swap hack guide can be found at http://www.resexcellence.com under the MacOSX Mods Section. While it lacks the polish of my latest document in terms of explaining how and why swapfile partitions work, it will more than suffice for those of you who simply want to do the hack.

Please be a little patient. I'm working on this and hope to have it fixed sometime today.

Thanks!

Andy

 
Files are Fixed

Thanks to everyone for being patient with the swapfile PDF corruption problems. I tracked it down to errors caused by the pasted screenshots. As a result, the new file has been formatted in TexEdit and the screenshots have been replaced with Terminal text dumps.

While this isn't as visually striking as the original file, I'd rather you all had something useable instead of something you couldn't work with. I have reposted this to my iDisk and download tested it and works perfectly.

I'll also upload a PDF version from Preview sometime later today.

If you'll excuse me I'm late for an appointment with some 450 lb. deadlifts.

Thanks again for your patience,

Andy
 
why are there so many neghits?

surely there aren't that many clueless dumbasses that visit this site.
 
A thank you to those who help out

I'd just like to point out that Andy is doing this from kindness and goodness of his own heart.

<RANT>
If there is one thing I am sick of seeing it's people who seem to think that the world owes them a debt because they are using MacOS X. I have particularly seen this attitude underlying conversations on running GNU GPL software on OS X, but it applies to this thread just as much.
</RANT>


I thank everyone who makes information on any technical tweak freely available, and suggest that if people have a problem with formats, etc. they mirror the content themselves, of course giving credit where credit's due.

If people like Andy are discouraged then most of us will never find out about tweaks like this, and we'll all have to suffer thinly veiled attempts to sell CDs (*cough* macgimp.com *cough*) because the good projects have dried up (anyone interested in running X windows or GIMP on OS X please look to fink.sourceforge.net).


Anyhow, I've gone offtopic with this little flamebait...

---

On an unrelated topic, doesn't it seem the default face is frowning? Maybe that's why there are so many negative topics! (Glass half empty guys... SMILE!)
 
Thanks Angus,

My thoughts exactly. I love breaking ass on something for months only to have people bitch that it's not set up on a web page. If someone can't download a 44k rtf file, then I would rather they didn't do the hack in the first place.

I'm busy enough as a full-time industrial engineer and part time personal trainer/nutritional consultant. if someone else wants to make this into a web page, then that's fine but somewhere in and between trying to do a service to the OSX community, I'd like to have a life.

Nuff said.

Andy
 
Negative Responses

My first time to this site and i mistakenly thought that clicking the "negative" link would take me to a page that would have all the unfavorable comments about this swapfile hack . I was curious to know why others seemed to think this was such a bad idea. After realizing my mistake i went back and clicked a positive vote to even things out. I guess i should go click another positive vote because i'm glad the article is there even if i end up not being able to make the hack work for me.
 
In Case of Trouble

Steve,

If you do have problems, e-mail me for technical help to get through it. No one who's sought my assistance has left without a working swapfile partition.

Andy
 
How will this affect OS 10.1?

Is this the kind of procedure I should do after I install OS 10.1? I'm wondering what whether or not the upgrade to 10.1 will recognize the changes, etc... Or if I should just hold off until I upgrade to 10.1.

Thanks.
 
I mention in the FAQ, that it's not known whether the changes are overwritten by installing 5G55. At worst, you'll only have to redo the terminal work, so I see no point in not doing it. Once you have upgraded to 10.1, make sure that the fstab and rc files point to your swap partition, If not, su to root and re-do the hack. If you've done it once, doing it a second time is easy enough.

Hope that helps,

Andy
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.