I second basszero. Setting up and experimenting with virtual machines can be a very educational experience. I recently upgraded to 4 GB of RAM so I could run Windows Server 2008 in a virtual machine.

There are several applications you can use to set up VMs but my preference and recommendation is Sun's Virtual Box. It's really easy to use and offers the ability to keep snapshots of your VMs as you change things so you can easily revert back if you screw something up.

If you really want to get into the nitty-gritty of VMs, Xen is a great virtualization tool run in Linux. Check out the Xen website for more information and if you're ever looking for an excellent book on Xen, I highly recommend Running Xen.

You can also create a RAMdisk, which is a virtual filesystem that's backed entirely by RAM (which of course means it's not persistent - anything you put in here disappears when you shut down your computer). It's great for temporary directories because the file access and read/write is blazing fast.

Alternately, you could just do nothing. OS X 10.5 is pretty good at using all the RAM it can get its hands on.

If you're using Xcode for development, you could probably crank up the number of parallel tasks it runs; the default will be the number of CPUs. (The user default you can use to change this is PBXNumberOfParallelBuildSubtasks, you can tweak this with Secrets as well.) With that much RAM a dual G5 might be able to build even faster with three to six build tasks instead of two, since compiling is such a mix of I/O and CPU load.