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.

342 questions
0
votes
1 answer

kswapd process causing high system CPU

I'm troubleshooting some issues with my RHEL 5 server. This is an Oracle DB server which are running for a while now without much issue. Lately I notice that the server load is relatively high due to KSWAPD processes causing high CPU usage. Upon…
Jason Oon
  • 1
  • 1
  • 2
0
votes
1 answer

Machine swapping despite there being enough memory

One of our Docker hosts is swapping like hell for no reason - at least, no apparent one (it's a Ubuntu 16.04LTS VM). All Docker containers in summary only use ~4 GB of the 12GB RAM total, but the system uses 10GB of physical RAM in addition to 6GB…
0
votes
0 answers

Swap unused, high memory usage and swappiness at 100

I'm running a server with a number of game servers on it. My memory usage is very high, however there is almost no swap usage in comparison. My swappiness is set to 100 total used free shared buff/cache …
0
votes
1 answer

JVM heap is being swapped causing GC go haywire - Tomcat

Info: # of VMs= 4, each with an instance of Tomcat 8.5.* in cluster Apps = 5 war applications- 2 UI applications and 3 Webservices. Java Version = java 1.8.* Configuratin = 2 LTMS and 2 Apache Webservers - 1 LTM on top of tomcat clusters which…
prashma
  • 1
  • 3
0
votes
0 answers

Cannot mount swap partition at boot on Amazon Linux 2

I am trying to mount swap partition in etc/fstab on Amazon Linux 2, but it doesn't work on the boot-up process. here the steps I have followed: create swap file: dd if=/dev/zero of=/swapfile bs=1024 count=1048576 change permission to 600: chmod 600…
fromthestone
  • 347
  • 4
  • 17
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
  • 714
  • 7
  • 15
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
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
  • 400
  • 6
  • 18
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
  • 8