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
3
votes
1 answer

Windows Server: Prevent process swapping/paging

Is there a possibility to prevent swapping for a single process? This process is an in-memory-database and should not be moved to virtual ram. all other processes should still be swap-able. I need something like the "lock pages in memory" option…
3
votes
1 answer

How does the Windows /3gb switch relate to physical RAM?

I have a 32-bit Windows server with 4 GB of RAM. From reading various articles on the web, I reached the understanding that enabling the /3GB switch in boot.ini would mean that of my 4 GB of RAM, 3 could be allocated to user mode memory. Without…
Brian Beckett
  • 509
  • 1
  • 4
  • 12
3
votes
4 answers

Running swap on RAID10 or RAID5?

In follow-up to this previous question (and it's excellent answer), I am curious to know if running swap on a RAID5 might not be better than on a RAID10. My thinking is that you might lose a bit on the performance because it wouldn't be purely…
warren
  • 17,829
  • 23
  • 82
  • 134
3
votes
4 answers

What size relative to amount of memory should the page file be (in Windows Server 2008)?

I have heard the old advice for Windows NT 4 which, if memory serves, was a rule of thumb "memory size plus 12 MB" (so that a complete dump could be written to disk). Does anybody have any recommendations for Windows Server 2003 and 2008? (Also,…
3
votes
2 answers

How to permanently remove /dev/zram0 as swap in Armbian

My Armbian Bullseye system insists on setting up swap space on /dev/zram0. I don't want it to, as I have created a swap partition that I would prefer to use. But I can't find how to permanently remove the swap space /dev/zram0. It can be removed…
mbrampton
  • 301
  • 3
  • 12
3
votes
5 answers

Newbie ask Swap Value: How much Swap do I have?

When looking vmstat, this is what I got: procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st 1 0 0 2872 0 0 0 0 …
Cintaku
2
votes
0 answers

measuring total swap with SNMP when swap is larger than 4TB

We have a system with more than 4TB of swap space. I want to measure it's memory with SNMP (because I'm using MRTG to graph it). SNMP is reporting negative numbers for memTotalSwap. I suspect that this is because it's being reported with a 32-bit…
vy32
  • 2,018
  • 1
  • 15
  • 20
2
votes
1 answer

AWS EC2 Amazon Linux is using swap even if it shouldn't

I have a few ECS servers running various apps. After a few mysterious outages I noticed that the instance is swapping hard and it consumes its IO Burst Balance rendering the instance useless. The facts: the machines are t2 and t3 instances with 2GB…
scream314
  • 23
  • 4
2
votes
5 answers

Solaris Unix systems swapping & blocked processes

Some users are complaining of poor performance on a brand new server. The only running on this machine is Oracle 10.2. At first glance everything looks ok: load is minimal, nothing in logs. The only thing i can find is that vmstat is complaining of…
user1855
  • 51
  • 1
  • 3
2
votes
2 answers

Is swap file required for a Postgres database running on AWS EC2 instance with 122 GB memory?

What is the downside for running a Postgres database without a swap file? This database resides on an AWS EC2 machine with 122 GB memory.
J.M.
  • 21
  • 2
2
votes
2 answers

Is there a way to force a single process to swap most/all of its memory to disk (NON-ROOT)

We are currently analyzing performance of some of our boxes at work and we find that we have boxes that are swapping a lot and things start crawling when that starts to happen cause we are using spinny disks. I had a theory that it might actually be…
csteifel
  • 273
  • 1
  • 6
  • 11
2
votes
1 answer

Make Ubuntu Server use less swap and more actual RAM

I have a server with 128 GB of RAM and a 100 GB hard drive in it. It seems to use pretty much swap instead of using actual RAM when rsyncing disks. I found other questions on Stack Overflow with similar problems, but none had a real solution. This…
Amon Bune
  • 41
  • 1
  • 5
2
votes
2 answers

Could swap use many inodes?

I have got a graph about high inode use of our server's disk but I haven't got any detailed information (like df -i) so I'd like to guess the reason. Operating System: Red Hat Linux Process: PDF generation
2
votes
1 answer

Delete a file that was created with fallocate

I started to create a swapfile. I used this command: sudo fallocate -l 1G /swapfile Then, I decided that I want to make the swapfile in a different path, so I used the command again with the right path and activated the new swap file. How can I…
Noam B.
  • 119
  • 3
  • 7
2
votes
1 answer

Lack of free swap space on linux Zabbix server

I have been getting this Lack of free swap space on Zabbix server on my aws instance via zabbix monitoring. I am thinking of creating say 2 Gb of swap space. Do I risk loosing or interfering with anything since it is a live server (being used). I…
Bob Mwenda
  • 21
  • 1
  • 2