It seems to me a swap file is more flexible.
|
A swap file is more flexible but also more fallible than a swap partition. A filesystem error could damage the swap file. A swap file can be a pain for the administrator, since the file can't be moved or deleted. A swap file is also slightly slower. The advantage of a swap file is not having to decide the size in advance. However, under Linux, you still can't resize a swap file online: you have to unregister it, resize, then reregister (or create a different file and remove the old one). So there isn't that much benefit to a swap file under Linux, compared to a swap partition. It's mainly useful when you temporarily need more virtual memory, rather than as a permanent fixture. |
|||||||||||||||
|
|
A swap partition is preferred because it avoids the overhead of the file system when all you need is an addressable pool. But nothing prevents you from using a swap file instead of a swap partition, or in addition to a swap partition.
In order to start using the swapfile always at bootup, edit /etc/fstab and add
[1] http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/custom-guide/s1-swap-adding.html |
|||||||||||||
|
|
I think that it is mainly because the access time to the datas located on a partition are lower. The point of the swap file is more to help the sys admin when he is really out of RAM and needs to operate huge operations that would maybe crash his system. In this case he will sporadically create swap files when needed. But anyway you can have both of them. |
|||
|
|