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

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

hard disk have enough swap area by df -h but in task manager is showing swap less

hard disk have enough swap area by df -h but in task manager is showing swap less how to done this? https://i.stack.imgur.com/aUEqI.png https://i.stack.imgur.com/qEvbC.png
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

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
  • 163
  • 1
  • 9
0
votes
0 answers

Swap settings for GPU cluster

I am administering a GPU cluster which is MOSTLY used to do Deep Learning and I have limited sys admin knownledge. I noticed recently that the swap was set to default (swappiness at 40) and that some jobs are fully using it. At first I was thinking…
Thomas
  • 113
  • 4
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,033
  • 11
  • 37
  • 72
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
  • 474
  • 5
  • 17
0
votes
1 answer

Ubuntu 18.04, 1.5G Swap 100% used (32G RAM), soft RAID1. How to increase SWAP size?

I have a production server, recently, I have seen server becomes slow sometimes, and SSH is slow, and once get into the terminal, even press ENTER is slow. When the server is OK, I checked the memory usage and CPU, CPU looks fine, RAM looks fine…
The MW
  • 103
  • 1
0
votes
0 answers

AMD Optane alternative

I want to have an Optane features with my Ryzen build: high TBW and high I/O. Disk space irrelevant (like MEMPEK1W064GA, 64GB would be enough for me). And it would be nice if I can utilize the full power of my free PCIe 4.0 lane. Now I have an PCIe…
tchspprt
  • 1
  • 2