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

Solaris: how to list swap space per process?

On Solaris, how can I find out how much swap space a given process is occupying? Or even better, how can I list all running processes sorted by swap space usage? I'm asking this particulary for Solaris. I do not have the top command available and…
dokaspar
  • 155
  • 1
  • 2
  • 8
1
vote
0 answers

Why is my server using swap even though there is lots of RAM available?

My server has 24 cores, 16 GB RAM, and 8 SSDs on raid 0 (I think). I've noticed it is now using a low of swap space, even though there is plenty of RAM available. load average: 2.70, 2.54, 2.50 Mem: 16303072k total, 1546160k used, 14756912k free, …
Steve
  • 211
  • 1
  • 3
  • 9
1
vote
2 answers

Why is my server swapping at all?

Munin shows ram that is doing nothing most of the time. But swapping still happens. Quite regularly actually, bogging down the hdd. Or am I seeing the ram graph in the wrong way? How would I go about diagnosing this kind of problem?
1
vote
1 answer

Server failure in minutes due to high httpd-apache use (attack or bug)

In the last week suddenly I get errors for my server. I try to access my website I get 503 errors. When I check top and other things I see these: 60-65 httpd (apache) processes. (Normally I have 30-35 httpd processes) You can see graph here: httpd…
trante
  • 131
  • 5
1
vote
2 answers

KVM under CentOS, swap exhausted, physical memory available

I've had a test CentOS KVM host running for about a week now with 3 CentOS guests. There's 12GB physical RAM with about 7.5GB actually allocated to VMs. These VMs aren't even being used yet as the server's still in the testing stage but I've noticed…
batfastad
  • 456
  • 1
  • 10
  • 22
1
vote
1 answer

Why is /proc/meminfo reporting misleading SwapTotal after suspends

Consider this: [skrat@apex geri]$ cat /proc/meminfo | grep SwapTotal SwapTotal: 18438120 kB [skrat@apex geri]$ swapon -s Filename Type Size Used Priority /dev/mmcblk0p2 (deleted) …
skrat
  • 485
  • 1
  • 7
  • 14
1
vote
1 answer

Server crash when creating a swapfile on a running machine (CentOS Linux)

I created a swap file with root on a running server, using swapfile creation guides which I found on the net (http://blog.serverbuddies.com/adding-additional-swap-space-to-your-linux-server/m Create swap file on a running Linux machine, and…
giorgio79
  • 1,747
  • 9
  • 25
  • 36
1
vote
1 answer

How to change the SWAP file disk in Mac OS X?

I have moved my system on andexternal Raid 1 enclosure attachet to my iMac through Firewire 800 (the best an iMac can do ;-( ) ... I'd like to move the swap on the internal disk in order to increase somehow the performances ... How can I achieve…
drAlberT
  • 10,871
  • 7
  • 38
  • 52
1
vote
2 answers

e2fsck on a low-memory machine: can I get more out of scratch_files or swap?

I am running CentOS 6 on a 32-bit machine with 1 GB of RAM. I have a 1TB external HDD that I am trying to run e2fsck on. It runs for about an hour and a half and then fails with Error storing directory block information (inode=45206324, block=0,…
1
vote
1 answer

How much space is in a Solaris /tmp filesystem?

On Solaris, the /tmp filesystem is a filesystem of type "tmpfs". It's implemented in the kernel by allocated space from the virtual memory pool. That means allocation interacts with the available RAM on the machine and the swap space available. If I…
Chris Quenelle
  • 183
  • 2
  • 7
1
vote
1 answer

CentOS webserver memory overflow - cannot log in

Few days ago, my CentOS 6.2 webserver with ISPconfig 3 went down to the extent I wan't able to log in via SSH nor using a console. The console was full of messages "out of memory, killing process, sacrificing children" or something like that. The…
Jan Svab
  • 103
  • 1
  • 2
  • 10
1
vote
2 answers

Ubuntu: forcing processes into swap, or into RAM

I am now solving the following problem on Ubuntu: Is it possible to specify if one process should run only in the RAM (i.e. is not allowed to swap) or reversely only in the swap part? I mean that the process should be killed by the system rather…
stanekr
  • 11
  • 1
  • 2
1
vote
1 answer

How to instruct linux not to swap out hot pages of mmaped files?

I have a server where I run worker processes that mmap serveral rather big read-only "dictionary" files (~8GB total). Tests showed that they actively access only around ~1GB worth of the pages in these files. On the same server I run another process…
1
vote
2 answers

How can I determine the method of this DDoS attack?

My server went down earlier - looks like a DDoS. A spike in traffic to around 13mbit, the swap goes from idle to maxed in about 5 minutes, and server stops responding. I would like to protect against the attack but I can't determine the method.…
monkeymatrix
  • 167
  • 1
  • 2
  • 7
1
vote
1 answer

Swap space maxing out - JVM dying

I have a server running 3 WordPress instances, MySql, Apache and the play framework 2.0 on 64m initial & max heap. If I increase the max heap of the JVM that play is running in even by 16m I see the 128m of swap space steadily fill up until the the…
travega
  • 206
  • 1
  • 2
  • 9