Quote:
Originally Posted by Rick069
Is there a relation between a linux swap file and ram? I have 6gb of ram and I'm wondering if I need a swap file.
|
The amount of ram you have is not relevant. What's really relevant is the amount of ram you are going to use. If you have 6gb but you are going to run something that will be filling them them you need swap. If you have 256mb but you are going to run only a firewall on a headless box then you don't need swap.
The thing is simple as that. So, if you are lost, you could try defining the load that that box will have. For a regular desktop you are not going to hit swap easily with that amount of ram. Still, it doesn't hurt to have a one or two gigabytes partition lying around just in case. Note that, if the ram fills up, the kernel will swap, but if there's no swap space, it will just start killing programs without any consideration, and at that point, you might scream if it closes a document that you haven't saved for hours (not that you should do that, but things are not always as they should).
Some hibernation methods use swap to save an image of the ram. So, if you are going to use such a thing you will need to have a swap partition that's at least as big as your ram unless the image can be saved on a compressed form. I don't use hibernation so I don't really know much about that.