create the virtual swap disk:
thomas@thinky /usr/local/etc % sudo dd if=/dev/zero of=swapfile bs=1M count=1k
make it a swap space and enable it:
thomas@thinky /usr/local/etc % sudo mkswap swapfile
thomas@thinky /usr/local/etc % sudo swapon swapfile
to store it permanently add it to /etc/fstab:
thomas@thinky /usr/local/etc % sudo -s
root@thinky /usr/local/etc # echo "/usr/local/etc/swapfile swap swap defaults 0 0" >> /etc/fstab