Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'RE: why bother in the year 2002?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
RE: why bother in the year 2002?
Authored by: BraindeadMac on Oct 16, '02 10:54:55AM

You know back when RAM cost about $500 per megabyte and a 10 MB hard drive cost about the same we used to really worry about optimizing virtual memory performance because it really did make a difference--like in the 500-1000% performance improvement difference for compute intensive tasks. But the performance benefit you get with modern hard disks and the huge amounts of RAM and disk space available makes all of this pretty much mental masturbation for doing this on OS X. People report all sorts of subjective improvements, but the actual numbers provided by proponents of this technique are amazingly short of impressive. To get a "real" benefit you ought to be putting the vm space on a 0 striped LVD SCSI array which costs a whole lot more than just buying RAM. And that real benefit will only buy you a handful of percentage points improvement. I'm sure people are wasting more time trying to do this than they are actually gaining.



[ Reply to This | # ]
RE: why bother in the year 2002?
Authored by: jlneemidge on Oct 17, '02 01:09:29AM

For most users, raw VM performance is a secondary reason to move your swap space (i.e. if you're doing it just to get better performance, you're probably wasting your time). The real reason to move swap is to get it into an area where there's no competition. You can't run out of swap space if something goes nuts and fills up your boot partition, you can't get a fragmented swap file because your boot partition is fragmented, etc. It makes your swap space behavior consistent and predicatable, and that's a good thing.



[ Reply to This | # ]
RE: why bother in the year 2002?
Authored by: barrysharp on Oct 17, '02 10:33:43AM

The answer to all of this is to AVOID swapping all together.

Now I know that it's not possible to eliminate swapping all together but one can get very close to this. By installing as much RAM as is needed for running the machine's workload swapping can be minimised.

Memory is much more affordable today so this should be possible for most everyone today.

I have 1gig RAM in my iMac and I run for weeks at a time and swapping is practically zero. Over past two weeks my pageouts total about 350.

I've yet to encounter any program or OS created scenario that causes swap space to expand without bounds as the previous poster was refering to as a potential hazard. That's not to say it can't happen -- simply I'm stating I've not encountered it and hope that it never will.

I've been managing large UNIX VM systems for over 20 years and having to configure swap space is very wasteful because my goal has been to never overcommitt the system' physical memory resource. If this can be achieved (and it can if care is taken with managing incoming workload) there really is no reason to have swap space -- a total waste of disk and cost IMO. One must configure swap space in some systems as system dumps write to this area when system panics etc.

Regards... Barry Sharp



[ Reply to This | # ]
RE: why bother in the year 2002?
Authored by: WillyT on Oct 17, '02 10:32:27AM

I have 1.2 GB ram and I still get pageouts (91595(0)). With the swap on an separate drive I don't see the spinning lolipop very often as opposed to several second waits here and there without moving swap. Besides pageins require a read of the swapfile thus causing some minor thrashing. Pageouts require reads and writes causing thrashing.

Put it on a separate disk and all that is just a distant memory.
The only time I need to worry about mount order is during a reboot. Come up in single-user fsck and fsck_hfs everybody and exit. If everything looks good for fsck_hfs then the swap will come up right. If fsck_hfs -y /dev/disk0s10 shows something other than Swap then just reboot again. My uptime is nine days right now (would be more if shutdown now worked) so you see I don't worry about this every day.



[ Reply to This | # ]
RE: why bother in the year 2002?
Authored by: barrysharp on Oct 17, '02 11:06:11AM

From your swapping activity I would venture to say you're overloading your system and/or you're using programs that employ poor memory management strategies.

I guess it's possible you launch programs that you use infrequently. This means that once they or a portion of them reside in physical memory and they lay dormant they have to be swapped out (paged out in bits and pieces) to make room for other programs you launch.

If you aren't going to use a program for some time then simply quit it and release the valuable memory resources it's consuming back to the system for reuse by other more important and *frequently* used programs you use.

Quitting a program will also protect it from a system crash in that if it's still memory resident or active at the time the system crashes there's danger that some of it's data hasn't made it to disk for permanent safe keeping.

I also think a large fast HD dedicated to scratch files is of benefit as i/o is more likely to find big contiguous chunks of space to speed up data transfers. However, many programs don't provide the option to direct their scratch data to specific HD locations. Yes, there are some exceptions to this such as PS but many still remain that don't offer this.

My experience has told me to avoid swapping like the plague.

Now, as we start having the option of using multi processor machines such as Apple is deploying today in their G4 tower line the question of swapping becomes a little more interesting. With these systems it matters little if swapping is occuring so long as the CPUs aren't being starved because of such action or because of the swappin interferring with outher non-swapping activities. Having a separate HD for swapping may be a more worthwhile endeavor under these circumstances.

Regards... Barry Sharp



[ Reply to This | # ]
RE: why bother in the year 2002?
Authored by: robh on Nov 09, '02 04:23:55PM

Don't worry about pageins and pageouts unless you're getting lots of them while apps are running.

Chances are, you're getting them when starting apps or bringing them to the foreground after a long period of inactivity.

Now if you are running apps and you see tons of pageins/outs then you probably are very short of physical memory and hammering swap space. In these cases, throw a few bucks at the problem and add more RAM, it'll have a massively greater effect on the problem than moving the swapspace.

IMO, moving the swapspace on an OSX box is a complete waste of time and effort.



[ Reply to This | # ]