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

Exchange 2003 dial-tone with repaired database

After extensive Exchange 2003 DB corruption, we have set a dial-tone as emergency means of service for our users, then began restoring latest back-up to a recovery group, in parallel with fixing the corrupted database with eseutil. As the fix going…
SyRenity
  • 3,159
  • 11
  • 55
  • 79
1
vote
1 answer

OpenVZ Swap space?

From what I understand with OpenVZ you just increase privvmpages and vmguarpages for the swap memory, and even though the guest shows it as RAM the host will swap it were possible. Am I right here or does it work differently Update: Even setting the…
Not Available
  • 246
  • 1
  • 15
1
vote
2 answers

I've installed Lighttpd on my VPS, still the webserver relies on swapping

I've lighttpd on Ubuntu 10 on a 256MB RAM VPS. My goal is to completely avoid swapping. I'm running a Drupal webste with some images, shopping cart (no videos.. quite low estimated traffic). So.. still the system is swapping memory. I was wondering…
aneuryzm
  • 1,614
  • 5
  • 25
  • 40
1
vote
1 answer

Diagnose Memory Graph

The monitoring software we use has been flagged a box that serves two apps: Confluence (xms: 1 GB, xmx: 2 GB) JIRA (xms: 1 GB, xmx: 1 GB) These are the only two applications on the box; nothing else but it is a VM. Server Config VM…
OMG Ponies
  • 396
  • 1
  • 7
1
vote
5 answers

How "swappable" are RAID 1 drives?

My lab is considering setting up a server with an attached RAID device for storing our large imaging datasets. (probably a Mac Mini server with attached Promise SmartStor DAS w/ 4 1TB hard drives) Since there will be 4 1 TB hard drives, I would like…
hpy
  • 835
  • 3
  • 18
  • 28
1
vote
2 answers

System resets after swap memory is consumed partially

My System resets even if swap memory is consumed partially. What can be the reason for this? How can I can overcome this situation? I am using Suse Linux Enterprise Edition
Poorna
  • 161
  • 1
  • 2
  • 9
1
vote
1 answer

Is the memory which is transferred to swap due to swappiness still cached in the physical memory?

Is the memory which is transferred to swap due to swappiness still cached in the physical memory (until it is invalidated there)?
Ztyx
  • 1,365
  • 3
  • 13
  • 27
1
vote
1 answer

Why do I get swap space related errors when I still have lots of free memory in Solaris 10?

I am seeing a few of my services suffering/crashing with errors along the lines of "Error allocating memory" or "Can't create new process" etc. I'm slightly confused by this since logs show that at the time the system has lots of free memory (around…
Tom Duckering
  • 235
  • 1
  • 13
1
vote
1 answer

How to inspect why my service process be killed by Linux?

I have a vital service running a Ubuntu(20.04.1) server. Recently it is always killed by OS. At first I guess that probably is resulted by the OOM(out of memory) operation of OS, so I modified the systemd service unit file(my_app.service) of my app,…
Leon
  • 159
  • 7
1
vote
1 answer

Restricting swap usage for a systemd service in Ubuntu 18.04

I am trying to restrict the swap usage of a process using MemorySwapMax as mentioned in the doc with Ubuntu 18.04. Environment ubuntu@vrni-platform:/usr/lib/systemd/system$ uname -a Linux vrni-platform 4.15.0-143-generic #147-Ubuntu SMP Wed Apr 14…
tuk
  • 293
  • 4
  • 16
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
  • 461
  • 1
  • 5
  • 23
1
vote
1 answer

Do I need a SWAP partition?

I am going to remake a server with Ubuntu 20.04 It will have 6 GB of RAM, a 20 GB SSD for the operating system, and a 100 GB SSD for data. Should we make a SWAP partition ? If so, how many GB are needed ? Thank you
Mathieu
  • 35
  • 1
  • 7
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,123
  • 11
  • 22