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

Can swapped memory be read directly by java?

When the kernel swaps stuff to disk, can this data be subsequently read by the process directly from swap? or it must absolutely be put back into physical ram (thus generating si so activity in vmstat) I have a java process that seems to have alot…
Bob
  • 41
  • 1
  • 5
1
vote
1 answer

Swap partitions between /home and /var

I have a server with 2TB (Raid, 2x2TB), and this partition schema / => /dev/md2 - 20GB /home => /dev/md3 - 1.8TB This is a ISPConfig server, so we need many space in /var and almost nothing into /home, so i think that the best way to do this is put…
1
vote
3 answers

why after swap increasing and swapoff and swapon , swap total return to the previous value

in my Linux redhat machine ( version 5.x ) I perform the following steps in order to increase the swap from 6G to 8G lvcreate -n swap -L 2g /dev/rootvg mkswap /dev/mapper/rootvg-swap1 swapon /dev/mapper/rootvg-swap1 after steps swap increased…
King David
  • 433
  • 4
  • 17
1
vote
2 answers

How to remove SWAP partition, and add back to root partition in cli

I am on Ubuntu 14.04 server with only ssh access into the machine in question. Someone else setup this machine, and they added a ridiculous swap space...a little more than half of the SSD. Here's the current setup. sdb 119.2G disk …
trueCamelType
  • 1,016
  • 5
  • 19
  • 41
1
vote
2 answers

Linux swapping blocks system (freeze)

I have a problem with my Debian Servers. We run 4 different server which all have Intel CPUs and 128GB of RAM. Two of them run Wheezy, two of them run Jessie. We run a Java software on those systems which is heavily using memory and could eat up all…
mr.simonski
  • 225
  • 3
  • 12
1
vote
1 answer

Swap partition not mounted on boot

I'm having issues with a fresh SLES12 install and swap not mounting. It's a DL360 G6 server with P410 and 2x 146GB drives in RAID1. The single /dev/sda has MBR with sda1 for swap and sda2 for ext4 root partition. systemd 210-95.1 Basically i'm not…
vobelic
  • 183
  • 1
  • 5
  • 15
1
vote
2 answers

Implications of increasing physical ram of VM

I have a Centos7 VM running under VMware and I'm considering increasing virtual memory in the Centos VM. Currently my VM has 8GB of virtual memory, 6GB of swap and using 0 swap right now. I am considering increasing the VM's virtual memory from 8GB…
Liviu
  • 113
  • 3
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
  • 456
  • 1
  • 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
  • 575
  • 3
  • 12
  • 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
  • 27
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