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
1
vote
1 answer

zram-generator doesn't create zram device

I try to used zram-generator to create a zram device but it doesn't work. I followed the steps listed in the README.md from the github repository. Install zram-generator using one of the methods listed above. Create a zram-generator.conf config…
fbrzggn
  • 11
  • 1
1
vote
0 answers

Swap space extensively used while enough RAM is available on Ubuntu 20.04.01

On a new dedicated root server with Ubuntu 20.04.01, running only MySQL 8.x the system starts to swap extensively while enough RAM is available. System: RAM 230GB Swap space 64GB InoDB_Buffer set to 170GB AMD EPYC 7502 Ubuntu 20.04.01 Swapiness…
merlin
  • 2,093
  • 11
  • 39
  • 78
1
vote
1 answer

CPU Limiting & kswapd0 Advice Saught

Through hours of testing, I have found that the nextcloud desktop sync client for ubuntu 20.04 (appimage or ppa) both seem to have a bug to where... if a common nextcloud file sync error occurs , kswapd0 spikes to 100% of CPU and the swapfile on…
Maestro223
  • 203
  • 2
  • 13
1
vote
1 answer

Swap being used when not necessary

I have: vm.swappiness = 1 as suggested here to prevent using Swap when there is plenty of available memory. (0 would completely disable swap, as far as I understand) In frequent cases, I end up with, say, 5GB swap used (total 16GB), while I have 9GB…
Nuno
  • 553
  • 2
  • 8
  • 26
1
vote
1 answer

Memory Running Low - VM Swapfile vs Host Cache

I have server running a VMware 5.5 hosting 3 VMs which are using all memory of my server. I've just added a 120GB SSD but I don't know what tool to use it to smooth performance a bit. Swapfile or host cache, which one should be correct?
1
vote
2 answers

Linux: The difference between "paging on major page fault" and "swapping enabled manually"

On a Linux machine, we can enable swap by commands like the following sudo fallocate -l 500M /data/swapfile sudo chmod 600 /data/swapfile sudo mkswap /data/swapfile sudo swapon /data/swapfile But even when this is not enabled, the kernel still does…
1
vote
0 answers

Puppet keeps pushing .swp files

Our current setup has a manifest/site.pp that include the following for all of our modules File { ignore => ['.swp'], } However when running puppet on the client side, it still tries to push the .swp file. Info: Using configured environment…
Tolsadus
  • 1,183
  • 11
  • 23
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
  • 487
  • 3
  • 10
  • 31
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
  • 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
  • 435
  • 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
  • 365
  • 6
  • 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