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

With Xen, when is Swap used?

I have a 512MB Xen VPS with 1024MB Swap. When I SSH into it and type "free -m", it shows I have around 50MB free memory. I had recently downgraded from a 1024MB plan because I didn't need the memory. Since doing that, my VPS has seemed a bit…
Dav
  • 5
  • 1
  • 3
0
votes
1 answer

LVM cannot detect my swap or '/' volume group but why is the swap still present

i have a server (hp x86 blade running OEL/RHEL5) that has a faulty lvm filter configured in lvm.conf filter = ["a|^/dev/emcpower.*|", "r/.*/"] we also use cciss devices so there should have been an accept statement in there for them at /dev/cciss. …
jwinders
  • 125
  • 1
  • 9
0
votes
3 answers

Socket and Swap Space

I have a system that is running out of memory and has a lot of open connections. but my swap space is not being used up that much. Can socket/socket file descriptors use swap space? This is for a linux system btw. Thanks
grassbl8d
  • 283
  • 2
  • 3
  • 9
0
votes
1 answer

SWAP CRITICAL - 100% free (0 MB out of 0 MB)?

ANy ideas how to address this issue ....I am on ubuntu 10.04 on amazon ec2 here is the image
Matt Elhotiby
  • 889
  • 3
  • 10
  • 22
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
  • 817
  • 2
  • 8
  • 16
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…
user80776
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
  • 195
  • 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
  • 195
  • 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
  • 387
  • 4
  • 13