1

My system: Dell XPS15 9550

Processor: i7 6700HQ

RAM: 16GB DDR4

Disk: Samsung pm951 (512GB NVMe SSD)

GPU: 960M

I'm new to Linux so I will dual boot Windows 10 + Ubuntu 16.04. I'm a network administrator, learning Linux Ubuntu until I'm very comfortable with Linux then I will be using Kali to practice pen testing.

How much Swap do I need, other advice?

  • 1
    In 99.9% of cases you don't need swap. I have 12 GB RAM and do not use swap. – Pilot6 Mar 17 '17 at 11:23
3

In general is always good to have some swap, but the amount scales in a non linear way with the RAM amount. In you case 4GB would be the recommended size, ref:

https://www.redhat.com/en/about/blog/do-we-really-need-swap-modern-systems https://access.redhat.com/solutions/15244

1

With 16gb of ram you should be fine for day-to-day usage. However, I'd recommend using a swap partition for learning effects (e.g. check behaviour of swappiness) and especially if you use hibernating, for which the swap partition in the size of ram is required.

0

While it's likely that normal everyday use will be fine with 16 GB RAM, for large applications (editing large images with GIMP, certain games, etc.) even that amount of RAM may be inadequate, and if that occurs, and you don't have a swap space, your system performance will plummet -- even to the point of possibly locking up and requiring a power cycle to reboot.

The usual recommendation is to use a swap partition twice the size of your physical RAM, though with the amount of RAM you have, it would almost certainly be adequate to use a swap space the same size as your RAM. On my own desktop system, with 8 GB installed, I have an 8 GB swap space (because I didn't resize it when I upgraded my RAM from 4 GB to 8 GB), and I have no problems -- but I don't often edit large images or play games that require large amounts of memory.

0

You can start all applications you typically use and check how much memory they consume. To check memory consumption use free -h. Example result:

             total        used        free      shared  buff/cache   available
Mem:           1,9G        1,1G        297M         67M        518M        595M
Swap:          3,8G        811M        3,0G

You should watch the used column value. If it is way under your memory limit you can have no swap.

0

I see you have a nice powerful hardware.

Still even on Systems of:
Processor:

$ cat /proc/cpuinfo|grep -i "model name"
model name  : Intel(R) Core(TM) i5-2300 CPU @ 2.80GHz

and RAM Memory

$ free -m
              total        used        free      shared  buff/cache   available
Mem:           7806        5530         693         529        1581        1425
Swap:          9999         883        9116

I see that even in a Desktop Environment there are Memory hungry Aplications like the Chrome-Browser which eat so easily the System-Memory up.
And in different occations Applications can grow extremely in Memory Usage, even if it is only for a few seconds.
In such cases if you don't have any Swap Partition you will experience Application Crashes. Therefore I always recommend to have some Swap available.

How much Swap on a System actually can be used does more depend on the Processor than on the System RAM Memory.
So I recommend even for small Systems to have at least 4GB of Swap.
I observed that the I5 Processor with a Swap filled up with 3GB reached a System-Load that makes the System unhandable.
Therefore creating a Swap Partion of > 8GB will not give you more performance and it is likely that it never will be used.

Not the answer you're looking for? Browse other questions tagged or ask your own question.