What are swap files?

FreeBSD, like many operating systems, make use of a concept called virtual
memory. This allows the computer to access more memory than physically
exists. Disk is used to store those pages of memory which don’t fit into physical
memory. These areas of disk are known as swap files.

How much do I have?

To see what swap files exist, use either of the following two commands. I’ve
seen no difference in the output, but that doesn’t mean much.

Things to watch out for

Well, I made a stupid mistake and perhaps you could add my experience to the page so
that this won’t happen to others.

I created one swapfile and it was great. But it wasn’t enough. so I created
a second swapfile. Unfortunately instead of pointing the second vntab entry to
/usr/swap1, I pointed it to /usr/swap0 just like the first vntab entry.

Wow! Every single program started seg faulting and core dumping. sendmail,
inittab, and every once in a while, the kernel. I couldn’t figure out wtf was going
on. Until like the fourth time I studied vntab I figured out the error of my stupid
ways.

I guess that’s what I get trying to compile things on a 486 laptop.

-sam

The moral of the story: If you create more than one swap file using this method, make
sure your entries in /etc/vntab are unique. Thanks Sam.