Unix systems, and other Unix-like operating systems, use the term "swap" to describe both the act of moving memory pages between RAM and disk, and the region of a disk the pages are stored on. In some of those systems, it is common to use a separate whole partition of a hard disk for swapping. These partitions are called swap partitions.
Questions tagged [swap]
1369 questions
475
votes
7 answers
How to empty swap if there is free RAM?
When I open a RAM-intensive app (VirtualBox set at 2GB of RAM), some swap space is generally used, depending on what else I have open at the time.
However, when I quit that last application, the 2GB of RAM is freed up, but the same swap space use…
jfoucher
- 22,644
- 8
- 29
- 29
457
votes
3 answers
How do I configure swappiness?
I need a step-by-step, simple and easy way to configure swappiness.
One Zero
- 26,773
- 26
- 87
- 109
340
votes
9 answers
How to increase swap space?
I have, by default, 250MB of swap space in Ubuntu, and I want to expand it to a larger size. I need 800MB, which I think will be enough to open several applications without having to hit the current limit of swap. I hope someone can help me.
Bruno
- 3,587
- 3
- 15
- 13
319
votes
22 answers
I have 16GB RAM. Do I need 32GB swap?
I read many places that the rule of thumb for swap space is to double the amount of physical RAM. However, 32 GB does seem a LOT. Do I need that much? Do I need it at all with this high amount of physical RAM?
Tamás Szelei
- 4,032
- 5
- 21
- 21
290
votes
6 answers
Why is swap being used even though I have plenty of free RAM?
I thought the whole essence of swap was to act as a temporary storage safety net when RAM was full but my swap partition is constantly being used even though I sometimes have as much as 3GB free RAM. Is this normal?
Mysterio
- 11,838
- 28
- 85
- 119
208
votes
9 answers
How do I add swap after system installation?
I did not create a swap partition during Ubuntu installation. Later, I freed up some space and made a swap partition. Now after each boot up, I am manually opening gparted to right-click the swap partition to turn on the 'swapon' option.
How can I…
user13593
181
votes
15 answers
Slow boot - "a start job is running for dev-disk-by..."
I don't recall when the issue started to occur but it's likely when I moved my VMWare Ubuntu image to an external SSD so that I can use the OS on any of my PCs. There aren't many links on Google about the issue but the ones that appear talk about…
cpd1
- 2,343
- 2
- 11
- 9
175
votes
6 answers
How do I increase the size of swapfile without removing it in the terminal?
Is there a way to increase my existing "swapfile" without having to destroy and re-create it?
I would like to up my swap space from 1GB to 2GB. Currently it is set up as such:
$ sudo swapon -s
Filename Type Size Used …
Dave
- 2,014
- 7
- 20
- 32
171
votes
8 answers
How do I disable swap?
I have some sensitive data in RAM that I prefer not to be on disk. How do I disable swap?
I have more than enough RAM. If RAM consumption gets too high I have no problems with processes being terminated. How do I disable swap?
Note: I do not have a…
user4482
133
votes
7 answers
Why are swap partitions discouraged on SSD drives, are they harmful?
I often read that one should not place swap partitions on a SSD drive, as this may harm the device. Is this true? Can you please explain the reason to me?
Because I otherwise would have thought that placing swap on an SSD is the best choice, as it's…
Byte Commander
- 105,631
- 46
- 284
- 425
109
votes
4 answers
kswapd0 is taking a lot of cpu
kswapd0 is taking 99.9% of my CPU as top shows me, the problem appeared today when gaming and first time it went away after 6 minutes and now it has been doing it for about 20 minutes. How is this fixable and what is causing this?
Kaspar
- 2,006
- 4
- 19
- 28
106
votes
6 answers
How can I turn off swap permanently?
Swap makes my system all sluggish and turning it off makes everything smoother. I have 3.5 GB of RAM.
I know how to turn swap off by entering sudo swapoff -a in the terminal, but that's just for the current session, because after a reboot swap turns…
Alex Li
- 1,251
- 2
- 12
- 15
86
votes
2 answers
zram vs zswap vs zcache Ultimate guide: when to use which one
What the hell are they? how are they different (I've written my understanding in an answer below)
In the Zswap system, when a page is evicted from the zswap to the actual swap is it stored in a compressed from? (or is it decompressed before…
staticd
- 2,925
- 2
- 16
- 19
83
votes
7 answers
Why most people recommend to reduce swappiness to 10-20?
I have seen in several site which recommend to reduce swappiness to 10-20 for better…
Saeed Zarinfam
- 17,232
- 6
- 35
- 41
76
votes
3 answers
How do I resize partitions using command line without using a GUI on a server?
I only have access to the server via a terminal and I can't use graphical tools such as GParted!
I want to create a new partition from a part of the root (about 768mb) for swap.
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda …
hamidfzm
- 941
- 2
- 9
- 16