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 never used, system freezes with high HD action when RAM is short

My system freezes quite often when run out of memory, I have 2GB and using netbeans, chrome, firefox and a few other apps this is consumed completely. Seems to me since I upgraded to ubuntu natty. ubuntu natty current uname -a 2.6.38-8-generic…
groovehunter
  • 243
  • 2
  • 7
0
votes
3 answers

Paritition an LVM LV

I have an LVM logical volume (LV) and would like to create partitions within this LV to provide an ext3 partition and a swap partition. This LV would then get mounted as a disk to a virtual machine (Using Xen). How would I go about this? Thanks
jtnire
  • 777
  • 2
  • 7
  • 15
0
votes
2 answers

Linux swap partition not recognized on reboot

When I reboot my Linux server the swap space reads 0 in top. I am running a vanilla install of CentOS 5.2 /etc/fstab looks fine from what I can tell /dev/VolGroup00/LogVol01 swap swap defaults 0 0 swapon -a returns "invalid params" error message…
Jared Brown
  • 247
  • 2
  • 6
  • 15
0
votes
3 answers

How does putting swap space on an SSD affect performance?

This is more of a generic question I'm interested in, rather than something I'm planning to use in production. If I got, saym a 40GB SSD drive and allocated the entire drive to be swap space leaving just a small amount of 'real' ram in the system…
Smudge
  • 24,039
  • 15
  • 57
  • 76
0
votes
3 answers

Moving/Adding Additional Swap Location - Redhat 5

OK, here's what's going on. I've got a RedHat 5 server with a swap partition (/dev/sda3) that's 3GB. For some reason swap memory is still being taken up on / (/dev/sda2), and fills up the drive on occasion. Is there a way I can tell my system that…
Devar-TTY
  • 213
  • 1
  • 4
  • 12
0
votes
2 answers

linux + swap definition

how to decrease the Priority to 1 in place of 2 as described below? swapon -s Filename Type Size Used Priority dev/cciss/c0d0p6 partition 8385888 0 -2
klod
  • 175
  • 2
  • 8
0
votes
1 answer

LINUX + red hat + How to define swap on disk partition: /dev/cciss/c0d0p6

How to define swap (8G usage) on disk partition: /dev/cciss/c0d0p6 ( i have Linux red hat 5.3) for example: in my machine I not have swap definition Swap: 0 0 0 the target is to create the following swap: swapon -s…
klod
  • 175
  • 2
  • 8
0
votes
2 answers

Memory is available, but swap gets full over time

On a small VPS of mine, I have enough free memory for the things that are running there (as in the log below), but every once in a while, when I run free -m, I see all the swap is taken up. What could it mean? Is it something I should be worried…
deusex
  • 1
0
votes
1 answer

AIX swap usage shows ~20%, not even close to maximum load

I got an alarm that my swap usage was up to 80%, which turned to be a fact when I checked topas. The problems I've found were: 1) Looking into a vmstat 5 10, I found lots of PIs with 0 SRs. How's that even possible? kthr memory page…
filippo
  • 219
  • 3
  • 9
0
votes
2 answers

PHP APC on 64MB box

I have a small VPS with 64MB RAM. I use it as an internal proxy. I only have one index.php on this server, which has the logic to fetch data from another server using php curl and display to the client (this is done for every request - there are no…
JP19
0
votes
2 answers

Which processes are swapped out?

Is there a way to easily find exactly which processes are currently "swapped out" (i.e. currently taking up my swap space). I know that processes are dynamically swapped in and out as needed, but I'm interested in the current state they are in. I…
Sec
  • 307
  • 4
  • 12
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,670
  • 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,383
  • 5
  • 32
  • 54
0
votes
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,033
  • 11
  • 37
  • 72
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