Create 1 MB swapfile for mdconfig and swapon.
# dd if=/dev/zero of=1MB bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes transferred in 0.035823 secs (29271150 bytes/sec)
# mdconfig -a -t vnode -f 1MB
md0
# swapon /dev/md0
# swapctl -l
Device: 1024-blocks Used:
/dev/ada0s1b 2097144 0
/dev/md0 1016 0
# mount -t tmpfs tmpfs /mnt/tmp
# dd if=/dev/zero of=/mnt/tmp/fill bs=1M count=2000
2000+0 records in
2000+0 records out
2097152000 bytes transferred in 36.267636 secs (57824337 bytes/sec)
# swapctl -l
Device: 1024-blocks Used:
/dev/ada0s1b 2097144 144220
/dev/md0 1016 1016
# systat -swap
Disk 1K-blocks Used /0% /10 /20 /30 /40 /50 /60 /70 /80 /90 /100
ada0s1b 2097016 144216 XXXX
md0 1016 1016 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XX