Swap partition, necessary?

is having a swap partition actually that important?

I have done an Arch install in the past without one and I didn't encounter any evident problems.

>muh 500 mib

but really

Use a swap file instead

I have it deactivated. I have 8 gb of RAM

...

no, just create a swap file

this but s/8/16/

swap is not needed if you have enough free memory. It is a useful balance to have both physical memory and swap at a 20% ratio. , 20% swap to physical memory. But if you build it now without it you can always go back and create a lv for swap.

Swap is a remnant from back in the day when you had 128kb of memory, now you are most likely not going to need it

That's what I thought, but lots of Arch people still seem to use it relgiiously, so it made me wonder

If you don't have a swap file/partition you can't hibernate your computer.

If you don't have a swap, then programs might start getting killed once you run out of memory, which might not be an issue if you don't think that will be likely to happen.

If you haven't got a swap partition, you can still make a swap file by doing:

sudo fallocate -l 4096M /var/swapfile
sudo chmod 0600 /var/swapfile
sudo mkswap /var/swapfile
sudo vim /etc/fstab
(add this line:)
/var/swapfile none swap sw 0 0
sudo swapon /var/swapfile


Where 4096M is how big you want to make it.

Can I do this post-installation?

Yes

Cheers mate!

It is not necessary but I wouldn't advise not having any swap. If your RAM usage gets to 100% (with non-cached data) and you have no swap then your system will nearly grind to a halt.

Also no swap means no hibernation.

I would recommend a swap file.

new to arch?

>16gb meme

>Hey guys I insturlled the Arch Loonix

>is having a swap partition actually that important?

Yes

I had to create swap partition to be able to compile Cyanogenmod with 4GB memory.. swap file seems like a better way to go, thanks for the tip.

No but I think the kernel will kill processes when the RAM gets full

You can has more than 1 btw.

Use ZRAM instead

Not so "new" to Arch itself, but I've used an install i did quite a while ago for a while now. When i did that install i didn't make a swap partition but haven't noticed too many issues, and whenever i have looked into it, I see lots of people saying drastically different things

The old rule of thumb was have as much swap as you do ram if you want to hibernate. But now a 4gb swap partitiion should do no matter how much more ram you have.

Only if you have less than 4gb of ram on what you are installing it on really

No. I've been using Arch for three years on both my laptop (8gb) as well as my main machine (32gb) without swap and it's been running perfectly smoothly.

Stop this swap madness already, it's 2016.

there's no reason not to make a small swap partition, then sysctl vm.swappiness=1 to only use it as a last resort

Last resort for what? There is no point.

Not really. If you have 8GB+ of memory you are hardly at risk of maxing it out. I don't think I have ever hit above 6GB of usage on 8.

Don't you have to have a swap file at least as big as the amount of RAM in your PC?
I don't want to hibernate btw, because that would make my full disk encryption useless.

And if you do max out, you're fucked anyway. If 8GB of RAM wasn't enough, will your 4GB swap partition save you? If you really don't have enough RAM for the applications you're running, you need to buy more RAM. It's the only way to fix it.

Yes, if you use virtual machine, it will nees swap