Questions tagged [swap]

Swap space is an area of the hard disk that serves as an overflow when the computer memory is full. The memory used by inactive applications is partially written out to disk to make room for other applications and for the disk cache for active files.

173 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
1 answer
746 views

Kswapd using >90% CPU. What is it doing?

I have run GNU/Linux since 0.99, and it is only in the most recent years that I have seen kswapd use any serious CPU-time. In ye olde days the swapsystem would be waiting for the disk and hardly use ...
Ole Tange's user avatar
  • 35.4k
5 votes
1 answer
711 views

Find the swap options currently in use

If I mount my swap device as: swapon --discard=once --discard=pages /dev/sdb How do I later on check/find the options that I used, ie, discard in this example? swapon -s only gives me: Filename ...
Tom Hale's user avatar
  • 30.1k
5 votes
0 answers
279 views

Why does /proc/*/status not account for all swap used on a system?

I have a system that has been swapping recently and am unable to account for all swap that is shown as in use by tools like free or top. Specifically, I can account for 19GB of 28GB swap used (...
synic's user avatar
  • 51
5 votes
0 answers
530 views

Restoring in-memory/swapped page state on resume from hibernation

I'm a big fan of Linux's hibernation support, which works extremely well on all the (admittedly slightly older) hardware I've tried it on. I highly prefer it to full shutdown and power up. There's ...
i336_'s user avatar
  • 1,017
4 votes
0 answers
2k views

How to check actual RAM usage of tmpfs?

I know that tmpfs falls back to using swap if system is under memory pressure. I can query total tmpfs usage in KiB with df | grep tmpfs | awk 'BEGIN{sum=0} {sum = sum + $3} END{print sum}' but how ...
Mikko Rantalainen's user avatar
4 votes
1 answer
314 views

Linux aggressively swaps when doing large IO operations

I have a strange problem on my Debian 10 desktop system when I am doing large IO operations like copy large files from/to external drivers or also on the internal disc. I could pin this down to the ...
Tirus's user avatar
  • 41
4 votes
0 answers
508 views

Dual-boot Linux & hiberantion: share swap partition

I am using dual-boot on my laptop, but I only have 1 swap partition which is shared. Hibernation is enabled for both OSes I have installed. All works well except the case when I hibernate, and then ...
Maciek Talaska's user avatar
4 votes
0 answers
534 views

ZFS (on Linux) swap error upon shutdown

I have installed Debian stretch on ZFS (including the root filesystem) and have made a volume on the root pool which I am using as swap. Everything is working fine, except that I am seeing the ...
Binarus's user avatar
  • 3,320
4 votes
0 answers
492 views

FreeBSD shared swap partition with Linux

What must I do, to run these commands before Arch Linux calls swapon -a? mkswap /dev/sdaX swapon /dev/sdaX Just in case it matters, /dev/sdaX was created in FreeBSD 10.1 environment, as soon as ...
kAldown's user avatar
  • 277
3 votes
0 answers
834 views

Swap grows slowly with 80% available memory

This has few views - so let me try with a tl;dr Is my claim that there should be plenty of free memory correct? Or am I misinterpreting Meaning of the buffers/cache line in the output of free? Can ...
Claus Andersen's user avatar
3 votes
0 answers
392 views

Has Linux abandoned hibernation ? How to improve thawing process?

Is anybody trying to use hibernation under Linux (with a HDD), or am I the only one ? Is anybody satisfied with how it works, or am I the only one where thawing takes 20 to 30 minutes before the ...
ysalmon's user avatar
  • 339
3 votes
2 answers
722 views

How to configure Linux to use a swap partition on a different physical drive when the boot physical drive also has one?

I've installed Manjaro on a USB stick (I mean real installation, not the live ISO - Manjaro ISO lacks persistence support) and also made a swap partition on it. But I would like it to prefer using a ...
Ivan's user avatar
  • 17.6k
3 votes
0 answers
2k views

How do I make my system only use swap when RAM is totally full?

In the past, setting vm.swappiness to 0 meant the system would only swap when RAM was totally full. $ cat /etc/sysctl.d/99-sysctl.conf kernel.sysrq = 1 vm.swappiness=0 $ sysctl vm.swappiness vm....
Sparhawk's user avatar
  • 19.9k
3 votes
0 answers
316 views

Hibernate used to work perfectly, but suddenly stopped working

So the hibernate functionality on my laptop use to work perfectly with Ubuntu. I would hibernate when switching to Windows and then thaw coming back. I literally never shutdown my Ubuntu partition for ...
Trusty Patches's user avatar
3 votes
0 answers
615 views

Swap usage by process

We have CentOS 5.11 (64bit) and it has 64G physical memory and 4G swap and i am seeing 900MB swap is in used but trying to find out who is using it. I have tried following but its showing zero usage. ...
Satish's user avatar
  • 1,652
3 votes
0 answers
165 views

Is there anything like earlyoom for CPU usage?

There are programs like earlyoom that when RAM and swap are almost full, they kill processes. I was just wondering if there’s something like that that kills processes when the CPU is overloaded.
NerdOfLinux's user avatar
3 votes
0 answers
422 views

Can't delete a swap partition, says that it's mounted while swapon says it's not?

I have a swap partition mounted on /dev/sda6 Linux Mint 17.2/Windows 10 dual boot. Am using HP 2000 notebook PC with 4GB RAM. When I installed Linux Mint I created a swap partition which as it happens ...
Arden's user avatar
  • 41
3 votes
0 answers
89 views

Which parts of Memory can Swap Support

For this question, "swap" does not include RAM and only refers to the configured space on the disk. According to, http://www.ualberta.ca/CNS/RESEARCH/LinuxClusters/mem.html, a program's memory usage ...
Tosh's user avatar
  • 709
3 votes
0 answers
922 views

Swap on video ram in a VM

I have a very small VM running in a cloud with only 512 MB ram. I read, it is possible to use the video card as swap as descriped here: Graphics cards contain a lot of very fast RAM, typically ...
rubo77's user avatar
  • 28.8k
3 votes
0 answers
688 views

zram swap instability

I use Mint 13 Maya with mainline kernel 3.6.3 for Ubuntu Quantal on my Asus P53E Notebook. I use zram swap that comes with the package zram-config. I've noticed that using it the system to hangs at ...
Adam Ryczkowski's user avatar
2 votes
0 answers
130 views

Would adding extra RAM ease up kswapd processes?

I've an OpenVZ 7 node and the usage is as follows: Swap Usage: 58% RAM Free: 36% of 125.7GB I repeatedly see two kswapd processes firing up, using ~200% CPU collectively: Swappiness is set to 37. I ...
user12207241's user avatar
2 votes
0 answers
84 views

Application that depends on Disk Swap can only load on 1st try after Fresh Boot

(original text redacted, too much clutter, bad grammar, replaced by summary below) Screenshots with more detail here: https://i.stack.imgur.com/8xfZq.jpg Main symptom: Game that depends on disk Swap ...
Winampah's user avatar
  • 139
2 votes
0 answers
283 views

What is [kswapd] doing when there is no swap?

I have removed all swap from my testserver (i.e. it was booted with swap, swap was used actively, later swapoff -a was run). Yet now and again I see kswapd in top using CPU time: top - 00:53:37 up 2 ...
Ole Tange's user avatar
  • 35.4k
2 votes
0 answers
759 views

Fedora 32 Immediate Wake-up after Suspend

Description: On my machine, after I clicked "Suspend", when the system goes completely dark, it will always automatically wake up in 1-2 seconds. No data or status loss but I just can't get ...
Comrade Crusher's user avatar
2 votes
0 answers
148 views

"Preempting" less-used pages in high priority swap to lower priority swap

Let's say I've got two swap partitions on my Linux machine. One is zram and a higher priority. The other is on disk and a lower priority. I prefer the zram swap because it's faster. As I understand it,...
2rs2ts's user avatar
  • 163
2 votes
0 answers
451 views

Swap file with Btrfs and multiple device

System specs: # btrfs filesystem show Label: none uuid: 3899c47c-19e8-4db3-aac9-.... Total devices 2 FS bytes used 2.00TiB devid 1 size 931.42GiB used 690.01GiB path /dev/nvme1n1p2 ...
Maxime's user avatar
  • 323
2 votes
1 answer
467 views

Why is my computer using a lot of swap memory?

My computer has been freezing quite a few times over the last few months. I was initially using Ubuntu 18.04. I then upgraded to Ubuntu 19.04 and now I am finally on Ubuntu 20.04. And slowly it has ...
coder123's user avatar
  • 139
2 votes
1 answer
634 views

How to fine tune Linux cache/swap ratio?

I've got a problem with my PC which makes the GUI almost unusable, very sloppy until dead. I've come down in my analysis that it is caused by the cache/buff forcing too much swapping. Is there any ...
JPT's user avatar
  • 402
2 votes
0 answers
266 views

Is there a syscall to move memory back from swap to RAM?

I am wondering, is there a syscall, or has this ever been discussed, to move memory pages from swap back to RAM, given there is enough free RAM? I am thinking of something like the infamous swapoff -...
quazgar's user avatar
  • 881
2 votes
0 answers
125 views

Long boot: BTRFS, swap space, and LVM

I'm running into an issue where my computer hangs for close to 30 seconds on "scanning for btrfs file systems" during boot. I don't have any btrfs filesystems. I tried removing btrfs-tools and ...
ttshaw1's user avatar
  • 45
2 votes
1 answer
2k views

Disable swap file from the Linux kernel boot parameters

I am thinking of installing linux-lts as a backup kernel to use temporarily if mainline breaks (I'm on Arch). I use a swap file under Btrfs and that's not supported on Linux <5.0. Anyway to disable ...
Zethex's user avatar
  • 107
2 votes
0 answers
1k views

Hibernation with swap file under BTRFS

I am trying to get hibernation to work in Arch Linux. I am using a swap file in BTRFS, which is under a separate subvolume from / (both are under subvolume ID 5 A.K.A top-level). I am also using disk ...
Zethex's user avatar
  • 107
2 votes
0 answers
415 views

Hibernation with encrypted home and swap without initramfs

I have a Linux setup with an encrypted /home/<username> (LUKS) and without an initramfs. I currently have an unencrypted swap partition, intended for hibernation. For security reasons, I would ...
equaeghe's user avatar
  • 614
2 votes
1 answer
663 views

Do I have a swap space leak in FreeBSD?

I have a system with 16G RAM and 23G Swap (6 x 3TB disks in ZFS), currently the swap sits at 98% but I can only see 5G of ram used. I have checked all possible resources to find who is using the swap ...
thilo's user avatar
  • 21
2 votes
1 answer
996 views

can a full ram-disk cause swapping?

I have a application that is using /opt/otrs/var/tmp for caching a lot of temporary data. The vendor suggest that one option could be also to put this directory on a ramdisk (If you have enough RAM). ...
yesOrMaybeWhatever's user avatar
2 votes
0 answers
108 views

Linux kernel: Bigger swap-in chunks

I have been quite happy with suspend-to-disk. But getting more and more RAM, this is not really working as well as it used to. Suspending TO disk works fine: It takes a minute or 2, which is what I ...
Ole Tange's user avatar
  • 35.4k
2 votes
1 answer
645 views

Hibernate issues on Laptop/PC during high RAM usage

For several day/months I was trying to find solution for hibernation during high RAM usage on my laptop - Toshiba Satellite L50-B-1K6. I am facing similar issues on my desktop PC. My hardware ...
nexayq's user avatar
  • 301
2 votes
0 answers
213 views

Reference encrypted swap partition/device by label/UUID rather than raw device name

TL;DR: How can I reference an encrypted swap block device in safe way on CentOS 7? I'm trying to setup encrypted swap on a CentOS 7.2 VM, which has a swap device presented to it as /dev/vdb. This is ...
sxc731's user avatar
  • 401
2 votes
0 answers
1k views

Have troubles with hibernation on arch linux

My system doesn't resume after hibernation My hooks cat /etc/mkinitcpio.conf | grep resume HOOKS="base udev autodetect modconf block resume filesystems keyboard fsck" Then I done mkinitcpio -p ...
user3271237's user avatar
2 votes
0 answers
175 views

Why total swaps and page faults/reclaims is empty in ps?

I'm running the following command: sudo ps -axo nswap,majflt,minflt,command | sort -nr | head which suppose to print total swaps in/out, total page faults and reclaims. But for given >400 processes,...
kenorb's user avatar
  • 20.9k
2 votes
0 answers
189 views

Entire Harddrive to linux swap

I have an old hard drive that is less than 50Gb and a computer that only has about 4Gb of ram (and ~250Gb main HDD). I was thinking about using the second drive as an entire drive linux-swap partition....
USERID_UNK's user avatar
2 votes
0 answers
1k views

Java process gets killed frequently by OOM - Killer on upgraded hardware

I am running solr on an Ubuntu server along with 4 other java processes. Current index size is 30 GB. My solr process gets killed frequently in few hours. It clearly mentions that its an OOM killer. I ...
akshayb's user avatar
  • 121
2 votes
2 answers
1k views

slow Matlab on Ubuntu LTS and ZERO Swap

I was using Matlab2012 under Win7 and my algorithm was consuming a huge amount of memory though it was fast (80 seconds for one iteration). Now I am using Matlab2013 under Ubuntu 12.04 LTS and though ...
waleed shawki's user avatar
2 votes
1 answer
847 views

Page cache elimination in Linux kernel

Optimizing the page cache space for less memory utilization in some system where systems don't have swap space and external flash drive or hard disk. Is there any possibility that if we can remove or ...
LinuxLerner's user avatar
2 votes
1 answer
155 views

specific swap partitions for multiple debian instances in a single computer

I'm trying to setup a computer with three debian instances (wheezy, jessie and sid), I've created / and swap partitions for each debian instance, during the installation I did specify which swap ...
boclodoa's user avatar
  • 121
2 votes
1 answer
4k views

Which processes swaps memory

I can see swap's total, used, free etc. sizes from top command. But I can't figure out which process uses swap, is it possible to find out swap memory by process? I'm running CentOS 6.3.
trante's user avatar
  • 211
1 vote
1 answer
185 views

Is it safe to permanently remove swap in device with huge memory?

I have a desktop with 128G RAM. This is my typical memory usage when I am not running calculation-heavy scripts: sam@debian:~$ free -ht --si total used free shared ...
bgi8353's user avatar
  • 11
1 vote
1 answer
519 views

How can one move all ZRAM swap device contents to a swap file?

In a Debian system, how can one move all ZRAM swap device contents to a swap file within the same running session in order to free up RAM, without: Disabling ZRAM first (e.g., using swapoff), as it ...
e.o.'s user avatar
  • 11
1 vote
0 answers
234 views

How to wake up from arch linux hibernation in virtualbox?

I accidentally placed my KDE arch linux virtualbox vm in hibernation - by this, I mean that I accidentally pressed the "hibernate" button in the SDDM lock screen. The screen just went black ...
zmess's user avatar
  • 11
1 vote
1 answer
192 views

How to create a private swap file for a specific process or cgroup in Linux?

I'm currently attempting to generate a swap file in Linux that is exclusive to a particular process or cgroup. After going through the LWN article which discusses the patches that enable this ...
Elior Gigi's user avatar