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

Transfer used ram to swap and free more physical ram

I have a vps with 256m physical ram and 512m swap space, I am trying to use a software that need more than 256m and less than 512m ram, so it uses swap. The problem is at some moment of the installation, the installation process checks the…
0
votes
1 answer

SWAP reducing SSD write speed?

My SolusVM graphs have been showing 8Gb Swap usage even though the RAM is never over 50% used. Is it possible that virtual machines going into swap will reduce the IO of the SSD?
user3180
  • 337
  • 1
  • 4
  • 13
0
votes
2 answers

How do I resize full root or swap partitions in RAID?

It all began a couple weeks ago: When I try to use vi I get "E297: Write error in swap file $ echo "test" > test produces -bash: echo: write error: No space left on device My bash history is always empty Is not my quota as it happens with all…
Luciano
  • 163
  • 1
  • 4
0
votes
1 answer

Should I create a 8 GB swap file on my amazon image?

I have an Amazon image with 1 root image, 1 image that I uses for websites and is only using 25%, and 1 image "unused" So I thought... maybe I can use that unused image for a linux swap file. Since I have 10 Gb (9.2G Avail) would it be wise to…
edelwater
  • 487
  • 1
  • 4
  • 12
0
votes
1 answer

Swap files in Cloud Infrastructures

At our company we set up an OpenStack Cloud and are currently creating internal guidelines for creation of OS templates / images. One controversial topic was if we should provide swap inside the VM templates. Therefore I'd like to ask the following…
Florian Feldhaus
  • 241
  • 2
  • 4
  • 11
0
votes
1 answer

how do OS deal with dirty page if there is no swap space

As in text books OS will move dirty pages to swap space based on LRU algorithm and make space for new process in RAM. But how do OS do this if there is no swap.
Cray XT3
  • 37
  • 4
0
votes
1 answer

Very high Magento/Apache memory usage even without visitors (are we fooled by our hosting company?)

I am no server guy and we have issues with our speed so I come here asking for advise. We have a VPS with 2 cores and 2gb of RAM at a Magento specialized hosting company. Over the course of the last weeks our site speed has gotten worse, even though…
MrDobalina
  • 3
  • 1
  • 3
0
votes
1 answer

how can I tell if there is a cpu trashing on my linux machine

I want to write a script that will kill my processes when my machine is doing "too much" swapping of process memory from disk to memory. What is the best way to determine that? I saw top has %wa and iostat has iowait data. vmstat has swap in and…
oshai
  • 109
  • 2
0
votes
1 answer

My server is running out of memory, despite having all swap free

I am using Debian 6 (Squeeze). The server has 4gb of memory in it, and 8gb of swap. I'm starting to get memory alloc errors at high application load times, but from top command: Mem: 4055944k total, 3915436k used, 140508k free, 10444k…
goji
  • 245
  • 1
  • 3
  • 9
0
votes
1 answer

CentOS - Convert swap memory to regular?

Take a look at this screenshot that I took after doing free -m: http://gyazo.com/aa54d264956e56acb99024e2374de0c0.png?1340387738 I notice that I have a ton of swap memory not being used, could I convert that to something that CAN be used? I'm sort…
DannyF247
  • 103
  • 1
0
votes
4 answers

On a virtual Linux system where storage is on network what's the point of the swap file?

The Linux servers are running on some VMWare ESX systems (guessing, I'm just user). These systems don't have the disks directly attached: they perform everything on a virtual disk that is actually a file on a NAS. The Linux system is configured with…
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
  • 273
  • 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
  • 879
  • 3
  • 10
  • 22