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]
1406 questions
                    
                    509
                    
            votes
                
                8 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
        
- 24,444
                    488
                    
            votes
                
                3 answers
            
        How do I configure swappiness?
I need a step-by-step, simple and easy way to configure swappiness.
         
    
    
        One Zero
        
- 27,761
                    397
                    
            votes
                
                10 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
        
- 4,157
                    335
                    
            votes
                
                23 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,192
                    317
                    
            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
        
- 12,288
                    225
                    
            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
                    196
                    
            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,315
                    195
                    
            votes
                
                16 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,503
                    185
                    
            votes
                
                9 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
                    139
                    
            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
        
- 110,243
                    132
                    
            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?
         
    
    
        inimene
        
- 2,236
                    111
                    
            votes
                
                7 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,311
                    91
                    
            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
        
- 3,025
                    89
                    
            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,872
                    85
                    
            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
        
- 1,031