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

New Swap Drive - Linux Hangs during Boot

An application checked the swap space during install and required it to be the same amount as ram. So i added a new disk (Server is a VM) and done the following: swapoff /dev/mapper/ol-swap vgcreate swap /dev/sdc lvcreate --name swap -l 100%FREE…
embedded
  • 466
  • 2
  • 6
  • 19
1
vote
1 answer

How can I maximize the memory usage of a single Windows process?

I have a system with a large amount of memory. Right now, to prevent a single application from paging, I've disable the paging file completely. The issue that I'm running into is that I cannot maximize memory usage for the single process I care…
EGr
  • 609
  • 4
  • 14
  • 29
1
vote
1 answer

mysql swap file crash on freebsd

I have a low memory VPS that mysql and the swap file crash out every morning at exactly 0300. There are no cronjobs on the system that have been configured. The server is a basic LAMP development server and all settings are defaults. cat…
NIX
  • 11
  • 3
1
vote
1 answer

What happens when the swap folder on your harddrive is full?

So this is an "what if" question. It may not happen that often, but I am just curious what happens if it would exactly happen. So in short a computer needs space somewhere to store different thinks before or after an calculation. So you have the…
user277526
1
vote
0 answers

(mysqld), uid 88 inumber 281675 on /: filesystem full

I created a swap file that was a little to big. So I deleted it. The swap file is gone, but the free space is never reallocated. I have rebooted, fdisk is no help, not sure where to go from here. The file is deleted. error: (mysqld), uid 88 inumber…
nix
  • 145
  • 4
1
vote
0 answers

Docker memory swap account broken in ubuntu 14.04.2

I'm using ubuntu 14.04.2 . I saw that recently swap support was broken, maybe with a recent kernel upgrade? On a fresh install: cat /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT="cgroup_enable=memory…
Mascarpone
  • 872
  • 3
  • 9
  • 28
1
vote
0 answers

How to copy locked swap files in ESXi?

Based on this question : How to disable swap files in ESXi?. The main answer states that it is possible to extract data from the swap files (for exemple using strings) so I tried to make a simple copy of the file, but ESXi puts a lock on it. The…
user3779430
  • 121
  • 2
1
vote
1 answer

Get rid of \040(deleted) swap

By mistake one of our admin on a production machine, deleted the swap file from the system. Without swapping it off. Now we are getting this. /swapfile3\040(deleted) file 1048568 1048568 -2 /swapfile1\040(deleted) …
tollboy
  • 76
  • 1
  • 8
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
  • 165
  • 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
  • 231
  • 2
  • 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
  • 6
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
  • 11
  • 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
  • 505
  • 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,837
  • 9
  • 26
  • 36