Swap space is an area of the hard disk that serves as an overflow when the computer memory is full. The memory used by inactive applications is partially written out to disk to make room for other applications and for the disk cache for active files.

learn more… | top users | synonyms (1)

23
votes
3answers
6k views

Are there any side effects when two distros share a swap partition?

In order to save disk space, I want to have two OS installations share a single swap partition (a dual-boot). Is this a good idea?
74
votes
7answers
19k views

Why use swap when there is more than enough RAM

Using swap space instead of RAM can drastically slow down a pc. So why, when I have more than enough RAM available, does my Linux system (Arch) use the swap? Checkout my conky output below: ...
43
votes
2answers
3k views

What NOT to put on an SSD?

I bought an SSD and I am going to set up my desktop system with a completely fresh Linux installation. SSDs are known to be fast, but they have a disadvantage: The number of writes (per block?) is ...
19
votes
3answers
3k views

What does the vm.swappiness parameter really control?

Per the kernel documentation: This control is used to define how aggressive the kernel will swap memory pages. Higher values will increase aggressiveness, lower values decrease the amount of swap. ...
13
votes
4answers
5k views

How to re-load all running applications from swap space into RAM?

If my desktop run out of memory and swaps a lot then I free or kill the application wasting my RAM. But, after that, all my desktop/applications have been swapped and are horribly slow, do you know a ...
10
votes
6answers
2k views

Can Linux “run out of RAM”?

I saw several posts around the web of people apparently complaining about a hosted VPS unexpectedly killing processes because they used too much RAM. How is this possible? I thought all modern OS' ...
26
votes
7answers
1k views

Is swap an anachronism?

I've used unix for quite a while, and for the last couple years I've felt like swap is an anachronism, but I'd be curious what other folks think. My argument is roughly this (assuming no global ...
20
votes
4answers
28k views

How to completely disable swap?

I am using Debian sid, hard drive formatted with ext4, running on linux 3.1 I remember on previous linux versions (maybe before 3.0), if I run out of memory, and swap is not enabled, programs will ...
25
votes
12answers
3k views

How can I tweak my Linux desktop to be more responsive?

I have the experience that Linux works fine until the physical memory is exhausted. As soon as swap space is used the performance is severely degraded and the GUI becomes unresponsive. This problem ...
5
votes
2answers
5k views

Cleancache vs zram?

I have an old laptop here with only 512 MB of RAM. Since a few kernel releases, I am using zram to convert 256 MB of it to a compressed ramdisk which is then used as swap. This has proved to be very ...
15
votes
2answers
7k views

Why is swappiness set to 60 by default?

I just read some stuff about swappiness on Linux. I don't understand why the default is set to 60. According to me this parameter should be set to 10 in order to reduce swap. Swap is on my hard ...
19
votes
3answers
5k views

Why does Linux use a swap partition rather than a file?

It seems to me a swap file is more flexible.
8
votes
1answer
6k views

swapon: Operation not permitted

I'm running this as root, obviously. I've created a file called /swap/sw1, by dumping 512 megs of /dev/zero into it. I then ran mkswap, which said: Setting up swapspace version 1, size = 524284 KiB ...
6
votes
2answers
185 views

How can my HDD swap without a swap partition?

I have no swap partition on my disk because I prefer having the OOM reaper kill anything it wants quickly rather than having to wait 10 minutes for my swap partition to get filled + 5 other minutes to ...
6
votes
3answers
8k views

Swap usage too high?

I have a debian sid box, freshly installed about a month ago, with no desktop apps running at the moment. Any command I try to run (via ssh) makes the hard disk work very hard. The system worked ...
5
votes
3answers
1k views

How can I tweak the kernel for total swap out?

I would like to deploy the following swapping policy: By default all pages in memory should also be in swap space. When a page in memory is changed (i.e. dirty), the page should be written out as ...
2
votes
3answers
2k views

How is paging managed in the absence of swapping?

How is paging managed in the absence of swapping. If that is the case, how will a page fault be managed? What I meant is, if there is no availability for swapping, then how is Paging managed. I ...
11
votes
3answers
1k views

What is the purpose of multiple swap files

During installation of most (if not all) distro's of linux, the hard drive is partitioned to include a swap partition by default. It is possible to change this behavior with swapon -p priority ...
7
votes
3answers
4k views

Where to put swap space, at beginning or end and other swap questions

Where do I put my swap? Debian installation gives 2 choices: (1) at the end or (2) at the beginning of the disk space. What is optimal? What is the optimal amount of swap given my computer has ...
6
votes
2answers
34 views

How to make files inside TMPFS more likely to swap

I'm using tmpfs for my /tmp directory. How can I make the computer decide to swap out the files inside the /tmp before swapping out anything that is being used by applications? Basically the files ...
6
votes
1answer
1k views

How do I set up an encrypted swap file in Linux?

How do I set up an encrypted swap file (not partition) in Linux? Is it even possible? All the guides I've found talk about encrypted swap partitions, but I don't have a swap partition, and I'd ...
5
votes
1answer
145 views

can initramfs be paged out to swap disk?

I am using initramfs to boot Centos via PXE. The initramfs used memory is listed within the "cached" value in /proc/meminfo or via free. Since I need to calculate performance data, I need to know ...
1
vote
0answers
16 views

How to ask for a password to mount crypted swap at boot time on Linux Mint 16 with initramfs-tools? [duplicate]

I use encrypted home folders on my notebook, which prevents use of hibernation on standard setup, because - and for a good reason - besides encrypting the home folder with ecryptfs, it reformats the ...
1
vote
2answers
205 views

Swap bash script pins htop's memory usage

I deployed a hack to add swap space to a VPS that otherwise didn't allow me to use swapon to create a file. Prior to adding and executing the script, I followed the steps outlined here. and ...
1
vote
2answers
541 views

Can linux systems on multiple virtual machines share the same swap partition? [duplicate]

I'm trying to save some disk space between multiple systems and re-using the same swap partition (which seems to be fine). I'm now getting into multiple virtual machines and am thinking of a ...
1
vote
1answer
1k views

Drop_caches doesn't drop caches?

Sometimes I see my swap file is a bit bigger then usual. I tried sync && echo 3 > /proc/sys/vm/drop_caches to no avail. But when I tried swapoff -a it takes a bit longer but the swap file ...
0
votes
1answer
327 views

How to recover from a boot hang after deleting old swap?

I did a fresh installation of Fedora 20 in the free space of my hard drive after failing to upgrade from the older version. Everything seems to be working fine until I deleted the partition containing ...
0
votes
0answers
79 views

Is swapping the cause of high IO on my box?

I'm running a LAMP stack on an Amazon EC2 micro instance with 616 MB of memory. This seems sufficient to be able to run a few small websites with Apache, MySQL and PHP. I have one Wordpress site ...
0
votes
3answers
85 views

How to get data shown out of workspace or directly from application?

Because of some reason I had to use another web browser than my main which I use daily and I chose a small browser which I installed long time ago. This brower is called Dooble, version 0.07 ...