Questions tagged [swap]

Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory(RAM) and the swap space is the amount of virtual memory available. Linux has two forms of swap space: the swap partition and the swap file.

From linux.com All about swap space:

Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available.

Swapping is necessary for two important reasons. First, when the system requires more memory than is physically available, the kernel swaps out less used pages and gives memory to the current application (process) that needs the memory immediately. Second, a significant number of the pages used by an application during its startup phase may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other applications or even for the disk cache. However, swapping does have a downside. Compared to memory, disks are very slow.

Linux has two forms of swap space: the swap partition and the swap file. The swap partition is an independent section of the hard disk used solely for swapping; no other files can reside there. The swap file is a special file in the filesystem that resides amongst your system and data files.

Swap space size should be either similar to system RAM or double it's size.

340 questions
0
votes
1 answer

KVM hypervisor swap

I've had my first CentOS 7 KVM host setup for about a year now, it is a dual quad-core machine with 32GB of physical memory. I have a dozen VM's running with a total allocated memory of 23GB. This system has 4GB of swap and here is the current usage…
rwfitzy
  • 223
  • 5
  • 15
0
votes
1 answer

Trouble with SWAP on AWS

I created an AWS m3.large instance. It comes with a single 32GB SSD. During the creation process, I added a second drive for the system. I picked the second drive for the system: xvda1 and the original 30GB drive, I loaded as xvdb. When the instance…
EastsideDev
  • 301
  • 3
  • 13
0
votes
3 answers

Slicehost too much swap usage

I currently have a website running on Slicehost. It is running the MySource Matrix CMS which does take up a fair amount of resources. Every once in a while, I get an alert from slice host saying that my swap usage has been very high. And, when…
Zed Said
  • 707
  • 6
  • 14
  • 25
0
votes
3 answers

Why wouldn't I want to enable swap?

I recently had an issue where a rogue process caused some ec2 instances to run out of memory and crash. It probably shouldn't have been an issue, except I was using t2.small instances which are pretty memory constrained and it ran out of memory…
thexacre
  • 1,849
  • 12
  • 14
0
votes
1 answer

how to swap VM disks in azure?

I've have recreated a virtual machine in azure, when I did it azure assigned an OS disk to the VM which is normal and obvious, and I have a disk from my previous virtual machine. for now I got two disks in the panel: - OS disk - Data Disk what…
pedrommuller
  • 279
  • 5
  • 13
0
votes
1 answer

Run app only in swap

I've a very low priority level program who consume large of memory. I need to free RAM for other programs. My objective is to kill -STOP this process and ```kill -CONT when i need it. But RAM consumtion still problematic. So: Is it possible…
bux
  • 606
  • 2
  • 6
  • 20
0
votes
1 answer

Swapfile on SSD and Memory Speed Comparison

I'm running Ubuntu on Digitalocean's instance that using ssd as their disk, and I'm using swapfile to help memory does the job. What I wanna know is, how can we compare speed between ram and the swapfile? Is it really worth using swapfile on…
chipz
  • 119
0
votes
2 answers

Mount shows as swap instead of ext3

Easy all, I have a hard drive with 4 partitions setup. boot/swap/root/home I recently installed windows onto the / partition as i needed it, and now that i'm switching back to linux it's showing /dev/sda4 (the home partition) as being swap…
Andy
0
votes
2 answers

plenty of ram but still swapping

this is graph of my server ram you can see in graph that every time I restart mysqld, swap becomes zero. But increases over time. If i put innodb buffer pool in large size swap rises faster and if I lower it swap rising is slower.
Mehdi Azizi
  • 51
  • 11
0
votes
0 answers

swapoff running forever on LVM volume

I'm currently trying to resize my swapspace on a Proxmox VE server with LVM volumes, as I'm running out of space for LVM snapshots and the swapspace is fairly oversized: root@rb-srv-gus:~# free -m total used free shared …
etagenklo
  • 5,694
  • 1
  • 25
  • 31
0
votes
1 answer

lvresize: command not found - RedHat

No search results on google for this. So i am really confused now. I am trying to increase the swap space and lvresize says command not found. Please Help !! using RedHat 64bit
0
votes
1 answer

Debian 6 - Linux 2.6.32-5-amd64 - Samba server with 32GB swap - how should i reuse it?

today i have the mission to tuning a Debian samba file server, previously i never ever touched it. RAM = 16GB SWAP = 32GB first of i ran a parted -l and a free -h and i saw one 3TB hdd: /dev/sda 3TB /dev/sda1 1MB bios_grub /dev/sda2 2968GB ext3 /…
Matt
  • 103
  • 2
0
votes
1 answer

OpenVZ vSwap Host Configuration

I wish to allocate vSwap memory to my OpenVZ containers. Where does OpenVz get the vSwap memory from? If the host were to run out of physical RAM, would the host start to use its own normal swap memory? I ask this as I am using SSDs in our host…
jtnire
  • 777
  • 2
  • 7
  • 15
0
votes
2 answers

Linux swap, linear write/read

i'm puzzled if linux writes and reads on swap sequentially . Now i'm analizyng pressure on swap partition and it's strange that utilisation is near 90% (util column in iostat ) but throughput is just 10MB/s on 2xSAS RAID1 hdd's. Google couldn't…
aceqbaceq
  • 9
  • 1
0
votes
1 answer

Why the system information message when accessing an Ubuntu server doesn't match free -m?

Each time I SSH into my AWS Ubuntu servers I see a system information message, showing load, memory usage and packages available to install, like this: Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.2.0-51-virtual x86_64) * Documentation: …
Andres
  • 239
  • 4
  • 9