If performance is good - you're not having to wait while switching between apps, with the disk thrashing and the activity LED solid on - then there isn't going to be a lot of wear to worry about either.
You could allocate a 2G space for swap at install time, and later tune the partition/swap size down e.g with GNOME Disks. Personally I would try 512M or 1G to start with. I assume you're not thinking about hibernation (which would usually want 2G+ swap).
Then I could see how much swap I used, and if I hit problems with out-of-memory or slowdowns with full swap. I confess I'm not sure how I'd distinguish thrashing the swap (too much active apps, enabled by too much swap) v.s. the cache (not enough swap to page out inactive app memory). In both cases you'd see the disk light on and pretty full swap. Maybe vmstat 1
and watch the swap column, if I could test a problem case reliably.
I would be cautious about 2GB swap on an eMMC (lower performance than expensive SSDs). Linux desktop memory management has a somewhat checkered history, and the swapping won't have been designed for eMMC.
If you use all that swap you may find the machine's become literally unusable anyway. Running out of memory can be better because you get the machine back without rebooting. Though it may kill programs you wanted & expected to survive.
My GNOME shell with a few apps has about 1G "used" (swapable) plus 1G+ "cached" (read-only data/code, can just be re-read from filesystem).
If you had punted 1G to swap, how long would it take to swap all that back, given your eMMC? (GNOME Disks can benchmark partitions for you :). E.g. 10 seconds to read it? Then if you're swapping the previous working set out at the same time, the (slower) writes on the eMMC are going to take even longer. Doesn't sound great to me.
One small reason for swap is tmpfs. My /run
accumulates a meg or so, I doubt all needs to be in ram.
You just want to increase the swap size on your system using the space from sda2
. Your sda2
/dev/sda2 104G 74G 25G 75% /
You can add additional swap space to your system by using swap file created on /
that will utilize your sda2
. Just do:
dd if=/dev/zero of=/swapfile bs=20480 count=1M
and then do:
sudo mkswap /swapfile
sudo swapon /swapfile
and check, you swap space will increase by that amount using free -m
and yes , to enable it at boot time add the entry in /etc/fstab
/swapfile none swap sw 0 0
Best Answer
It's wise to have swap space setup. From years gone by, the recommendation was to have twice the swap as you had RAM. Now about 1:1 works fine. 16GB is ~1.6% of your total disk space, so probably not a huge amount to spare.
EDIT: Oh, nearly forgot, if you are planning to use suspend to RAM (which you should), then I recommend that you have at least as much swap space as you have RAM, in this case 16GB.