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

Increase Swap file size that already exists (EC 2 linux)

I created swap file doing this: sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=4096 sudo /sbin/mkswap /var/swap.1 sudo chmod 600 /var/swap.1 sudo /sbin/swapon /var/swap.1 I would like to increase to 16GB I tried running this command sudo…
Chris Muench
  • 417
  • 3
  • 9
  • 29
0
votes
2 answers

Isn't swap file in KVM guests wasteful? Is there a better way?

So I am running a bunch of guests on a bunch of servers and currently my "standard" guest partitioning goes like this: 1GB for /boot 4 - 8 GB for swap the rest for / I allocate various amounts of RAM to each guest, depending on the needs of the…
velis
  • 233
  • 2
  • 10
0
votes
1 answer

swapoff failed: Cannot allocate memory

Server's Output shows the following: # free -h total used free shared buffers cached Mem: 7.7G 7.6G 123M 156K 1.8M 248M -/+ buffers/cache: 7.3G 373M Swap: …
user533509
  • 1
  • 1
  • 1
0
votes
1 answer

Iomega NAS ix2-200 RAID mode questions?

I am looking forward to buy a NAS. Now I have found one which looks quiet interesting, it's the "Iomega StorCenter NAS ix2-200 4.0 TB". I will use it to store Mac OS X TimeMachine Backups and as a file storage over the network. But I am wondering if…
elhombre
  • 425
  • 1
  • 8
  • 18
0
votes
1 answer

Intermitent bug on encrypted swap over Ubuntu 18

Wanting encrypt swap and the only script I found to do it as I want is it: sudo -i cd /root mkdir -p ./.myfolder cd ./.myfolder swapsize='4G' curdir=$(pwd) flNmDev="myfile" flPtDev="$curdir/$flNmDev" …
Paul
  • 1
0
votes
0 answers

After enable rules of ipfw my server collapsed

I enable ipfw rules on my mail server. After some time server collapsed. In /var/log/messages is nothing information of my damage. But when I connected monitor, I saw some troubles with swap swap_pager: indefinite wait buffer Then I entered…
0
votes
1 answer

EC2 - Persist instance store swap volume after stop/start

I have an EC2 instance for which I want to configure a swap instance volume. I can do this relatively easily, by launching the instance with the instance store volume attached, and then running the following commands... $ sudo mkswap /dev/xvdb $…
user1751825
  • 313
  • 5
  • 13
0
votes
1 answer

Centos 6.10 Swap File Issue Wrong size

I have Centos 6.10 Server with initial swap of 3.81 GB working ok no issue. I noticed wrong swap today amount of 4kb. I tried removing the partition and recreate entry on fstab and remount but no avail. Also tried creating swapfile 8GB using…
jmazaredo
  • 202
  • 5
  • 13
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
0 answers

Why is my kernel choosing disk swap over 24G of inactive RAM?

Output below is meminfo from a Proxmox hypervisor. I noticed today that swap usage was 90%. I logged into the box and checked and and it seems there is actually 24G of inactive RAM. A couple minutes later, I noticed swap usage was at 99%. Why does…
Server Fault
  • 3,454
  • 7
  • 48
  • 88
0
votes
1 answer

rsyslogd uses 435M of swap memory right after restart

I have Centos 7 # cat /etc/centos-release CentOS Linux release 7.3.1611 (Core) fresh rsyslogd # rsyslogd -version rsyslogd 8.36.0, compiled with: enough free memory # free total used free …
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
  • 3
  • 16