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
0 answers

vm.swappiness works differently on CentOS 6 and 7

We have an Hadoop cluster of CentOS 6 (kernel version 2.6.32-504.el6.x86_64) and CentOS 7 (kernel 3.10.0-327.el7.x86_64) servers . All the nodes are configured with a swapinness of 1. All nodes have plenty of RAM availables. The CentOS 6 nodes never…
loicmathieu
  • 111
  • 4
0
votes
2 answers

Try to empty buffer and cache

I try to clear the cache and buffer. Because they grow very much and starting use some swap. Will it affect the system? The system running in production. Or is there any other solution? Memory total used free …
0
votes
1 answer

Server responsiveness and swapping

I know how swapping basically works, why it's automatic and why it's generally a good thing. There is, however, a common scenario where I wish I had more control. I write LOB web applications with IIS and Sql Server (this question is more general…
0
votes
1 answer

coreos: Why is there no default swap partition?

The standard install of coreos seems to come without a defined swap partition and swap setup. What is the reason for that? Would it be recommended do add swap space in coreos node, which works as kubernetes cluster, running docker containers? Note…
Mandragor
  • 221
  • 2
  • 11
0
votes
2 answers

ESXi - distinction between Host Cache, VM Swap File, System Swap, vFlash?

In ESXi 5.5, the host config has a number of similar sounding settings related to swapfiles and caches of various types. I understand the principles of write-back/write-through disk cache and swapping VM swap files to the host instead of their…
Stilez
  • 664
  • 6
  • 14
0
votes
0 answers

Red Hat Enterprise Linux 6 lvremove succeeds but causes system to not boot

I started with a fresh install of RHEL 6, and it created a default swap as a logical volume (/dev/vg_hostname/lv_swap), along with the root (/dev/vg_hostname/lv_root) mounted as / I then created a separate swap partition on it's own disk (/dev/sdb),…
ray_voelker
  • 113
  • 1
  • 5
0
votes
2 answers

Ansible throws an “ ERROR! A worker was found in a dead state ” error

When I run a playbook that simply copies a directory from one place to another, ansible throws ERROR! A worker was found in a dead state Error. After some googling, it looks like this is caused by the oom-killer killing the ansible process (but…
Sudh33ra
  • 169
  • 1
  • 2
  • 7
0
votes
1 answer

adding new partitions to a device the containing root partition

On virtual box, I have my root file system mounted on the LVM: # df -h | head -n 2 | tail -n 1 /dev/mapper/cl-root 1.5G 951M 404M 71% / The LVM is mounted on /dev/sda2, and /dev/sda has the following table: # parted /dev/sda print | grep…
category
  • 103
  • 4
0
votes
1 answer

VMware guest still swapped after reserving RAM

The guest was swapping, after adding 100% memory reservation it continued to do so. After a restart - after some time not much changed. How can a VM who's memory is 'reserved' be swapping?
romant
  • 526
  • 5
  • 21
0
votes
1 answer

LVM logical volume for /home partition corrupted after lvresize to increase swap space Fedora 25

I added 6GB of memory on an older Dell PowerEdge 1850 that we use just for backups to an attached hardware RAID from Promise Technology called a VessRAID connected by iSCSI. After a few weeks I noticed the swap space was only 2 GB and decided to…
RobbieTheK
  • 390
  • 5
  • 15
0
votes
2 answers

Increase Swapfile on operational system

new to this and I am trying to figure what will be the best way to go on about this. I have a system that I need to increase its swap file, I realized that the swap partition is not lvm so that is kind of out. However, my current swap partition is…
user3311890
  • 181
  • 2
  • 7
0
votes
1 answer

How do i enable memory overcommit on solaris?

on a solaris 8 server with a specific workload, how do i turn on memory overcommit (à la Linux) ? # Memory size: 65536 Megabytes sun[root] # vmstat 1 procs memory page disk faults cpu r b w swap free re …
Benoît
  • 1,331
  • 3
  • 11
  • 23
0
votes
1 answer

linux + how to know when swapoff -a should be ended

on my linux redhat machine I perform swapoff in order to drop swap pages that stays in cached swap! swapoff -a I waiting until now one hour and swapoff still work can we see some process or notification when swapoff should be ended ? remark - swap…
King David
  • 433
  • 4
  • 17
0
votes
0 answers

Nagios check_mem reports incorrect swap usage

We use check_mem.pl to check memory usage in Nagios. On one of our CentOS 6 servers, the check reports a warning about swap usage. However, upon checking, the server doesn't seem to use any swap. This is what top says: top output And the nagios…
Rens Verhage
  • 133
  • 1
  • 2
  • 7
0
votes
2 answers

Are there any risks I'm not considering for when a swap partition fails?

I'm planning to setup 4 drives in a raid10 configuration, but putting separate swap partitions on each (no raid), and letting the kernel do something similar to raid0. When/if one of the drive fails and it has swap data on it: The kernel may…
Shelvacu
  • 353
  • 2
  • 14