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

Question about VMW Virtual Machine Memory Swapping

I am using vFoglight and get this error, "[Critical] Virtual machine X has moved virtual machine memory from physical pages to the VMware swap file within ESX. This may adversely affect performance on this VM. The following URL can be used to…
Chadddada
  • 1,680
  • 1
  • 19
  • 26
0
votes
1 answer

Swap usage in top's output

On a Suse linux machine, I have these swap stats from the top utility: Swap: 2096472k total, 1230612k used, 865860k free, 1792880k cached What does the last number (1792880k cached) mean, and why is it sometimes higher than the total swap…
Eugene Yarmash
  • 2,433
  • 5
  • 34
  • 54
0
votes
0 answers

Creating a swap partition from existing one

I have the following disk setup: Disk /dev/sda: 53.7GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 14 1049kB 4194kB 3146kB …
0
votes
0 answers

Swap memory discrepancy

I want to know the status of swap memory on my system, to understand the same tried different commands, each command thrown different output, could someone help to understand the situation better command 1: free -m command 1 output: total …
Teckfrekk
  • 1
  • 2
0
votes
2 answers

High iowait, swap nearly always fully in use

I'm often experiencing slowness on a large server that is used by several users simultaneously, with many CPUs (72) and a decent amount of ram (125gb). Granted, the server runs a lot of stuff so gets a high load, but it pretty much never happens…
dreamer
  • 101
  • 2
0
votes
1 answer

Swap used but there is free RAM

I am surprised to see my Ubuntu 20.04 using swap as there is 700G in buffers/cache. It has never done this before. Is something wrong? I feel like it should return RAM used in buffers/cache to be free prior to using swap. # cat…
qq72
  • 1
0
votes
1 answer

Does my swapping server with ~80GB available RAM need even more?

I'm administering a Debian Linux x86_64 server with 125GB RAM, a 10GB swap partition and a swappiness value of 60. A free -gw output prints: total used free shared buffers cache available Mem: …
eheu
  • 3
  • 1
0
votes
1 answer

How to trigger swap space usage on linux?

Is there a linux command or process I can run to trigger or force it to use swap at a high rate, e.g. exhausting 50% of swap space? I tried copying files but only see memory usage going up and down.
newbie
  • 3
  • 1
0
votes
0 answers

can not stop my server from consuming 10 virtual cores on kswapd0

I have a 40 vcore machine. something happened and it has been running 20 at 100% forever. Htop shows a large number of ./kswapd0 processes. I tried techniques like echo vm.swappiness=0 | sudo tee -a /etc/sysctl.conf but nothing helped. Can someone…
bhomass
  • 101
0
votes
0 answers

Windows page file best practices in regards to dump file?

Last night we had a critical server go down. Running Windows 2012R2. It appears to have been a random blue screen but we can't find much in the logs. We do not seem to have a dump file. Investigating, I found this: "To take advantage of the dump…
0
votes
1 answer

Windows page file best practices in regards to dump file?

Last night we had a critical server go down. Running Windows 2012R2. It appears to have been a random blue screen but we can't find much in the logs. We do not seem to have a dump file. Investigating, I found this: "To take advantage of the dump…
0
votes
0 answers

Optimal Swappiness in Parallel R Processes

I understand that optimal swappiness depends on the application. Database servers often have a swappiness close to zero, while in many other cases it is apparently recommended to keep the default value of 60. However, I am not sure which setting…
Chr
  • 103
  • 3
0
votes
3 answers

Why does the system swap while it has enough RAM and is this harmfull?

I operate a 64GB RAM root bare metal ubuntu 16.04 server with SSDs that is under pretty heavy load. Now I learned that cloud servers generally disables swap as it can wear the SSDs in the long run. This makes me worry about my server as it swaps…
merlin
  • 2,093
  • 11
  • 39
  • 78
0
votes
0 answers

Non-obvious restrictions in virtual servers

I apologize in advance for a beginner question. What attributes should I check for besides the obvious CPU, RAM, storage and bandwith parameters when ordering a virtual server? Two settings which have made a virtual server unusable after setting it…
Beginner
  • 162
  • 1
  • 2
  • 8
0
votes
2 answers

"non-bind mount source /swapfile is a directory or regular file" warning

I created a swap file on an ec2 instance following this procedure: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-memory-swap-file/ When I run sudo findmnt --verify I get the following error: swap [W] non-bind mount source /swapfile…
StevieD
  • 514
  • 8
  • 24