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.

Filter by
Sorted by
Tagged with
2 votes
1 answer
29 views

Is it better to have NO swap partition on a system which is installed on SSD and has 256GB RAM?

Of course, the purpose for swap is if your RAM runs out. But with 256GB RAM, I doubt this will happen. A greater concern is that the frequent writing of the swap partition could wear out the SSD. As ...
0 votes
2 answers
40 views

How large should I make root, home, and swap partitions with a HUGE SSD?

I got a 1.5TB datacenter-grade SAS SSD, and I am now installing a new install of CentOS 7 on it (CentOS 7 will be changed to CloudLinux later). I am setting up the partition scheme and I have plenty ...
0 votes
1 answer
29 views

Why does hibernation require a swap space to be roughly equal in size to total system RAM when we have file mapping and demand paging?

It is my understanding that pages in memory containing things like program text and shared libraries that have associated real world files will actually map to that associated file instead of swap (i....
  • 1
0 votes
0 answers
33 views

Which partition should be at top /boot or swap partition?

I am installing Ubuntu and I was confused while partition that which partition should be at top /boot or swap partition? Because I want maximum performance. And is it good to create/home partition ...
0 votes
1 answer
23 views

Why does the swap mapper file get created even though I removed it from /etc/crypttab?

I have this line in /etc/crypttab for my swap partition: luks-4205519b-f3fe-468f-b05e-44f25f6882a4 UUID=4205519b-f3fe-468f-b05e-44f25f6882a4 /crypto_keyfile.bin luks,keyscript=/bin/cat I ...
  • 757
1 vote
1 answer
16 views

How to Get Total Count of Non-Swappable Pages in RAM?

I am trying to debug some ML code that requires pinned physical memory, and in order to help with this, I would like to figure out how much of physical RAM consists of pages that can't be swapped out (...
9 votes
3 answers
297 views

Why do processes on Linux crash if they use a lot of memory, yet still less than the amount of swap space available?

I am using Linux 5.15 with Ubuntu 22.04. I have a process that uses a lot of memory. It requires more memory than I have RAM in my machine. The first time that I ran it, it was killed by the OOM ...
  • 131
0 votes
1 answer
42 views

Kubuntu takes a long time to boot

Checked on many places, and no solution satisfied me, so giving out the info I believe that should help to know the issue. Thanks in advanced: $systemd-analyze Startup finished in 4.424s (firmware) + ...
0 votes
0 answers
41 views

Where accessing swap space is handled in Linux kernel?

I am working as a research assistant and this question is really vital for our group: We are looking for a way to inject delays when a process (i.e. a python program) is using swap space. For example, ...
0 votes
2 answers
191 views

On AlmaLinux 8 or CentOS 7, does vm.swappiness=0 mean that Swap is fully disabled?

I've been having an issue for many years where I have vm.swappiness=1 in sysctl.conf, but even though there's plenty of RAM available (possibly almost full in terms of cached, although still 4GB free ...
  • 103
4 votes
1 answer
414 views

Why do swaps that aren't in fstab attempt to mount at boot

I'm using Pop!_OS (Based on Ubuntu/Elementary OS). I've got swaps that are mounting at boot that aren't present in fstab. Because I've deleted those partitions, the entire boot process has to wait an ...
  • 163
4 votes
3 answers
1k views

Auto detect RAM and create double the swap memory

I'm able to auto detect RAM in GB as below and round off to the nearest integer: printf "%.f\n" $(grep MemTotal /proc/meminfo | awk '$3=="kB"{$2=$2/1024^2;$3="GB";} 1' | ...
  • 417
0 votes
2 answers
41 views

Ubuntu: problem with available SWAP

I am using Ubuntu Linux installed on server equipped by 96 CPUs. I noticed that when I run some calculations it uses almost all RAM and SWAP of the resources: total used ...
0 votes
1 answer
20 views

swap linux distro without using usb or cd or any kind of external storage device

swap ubuntu in my system to garuda linux without using usb or cd or any kind of external storage device I've heard its possible by changing the contents of sources.list file, but i think its only ...
2 votes
1 answer
132 views

Can a Linux Swap Partition Be Too Big?

Can a Linux swap partition be too big? I'm pretty certain the answer is, "no" but I haven't found any resources on-point, so thought I'd ask. In contrast, the main Windows swap file, ...
  • 231
0 votes
2 answers
643 views

OOM Killer triggered when available memory is high

I have been getting random kswapd0, and OOM killers even though available RAM -100MB. Already gone through many other similar issues, but I could not get why OOM killer triggered in my case. Hoping ...
3 votes
1 answer
480 views

Why is my system using swap when RAM fills up with cache?

I'm running openSUSE TW, 32 GiB RAM, 64 GiB swap (SSD). Swap usage is zero up until the point when RAM gets fully filled up with cache. I'm using htop to monitor it. Yellow/orange = cache My system ...
0 votes
1 answer
91 views

Remove swap partition and extend root one(ext4)

sda 8:0 0 400G 0 disk ├─sda1 8:1 0 953M 0 part /boot ├─sda2 8:2 0 7.5G 0 part ├─sda3 8:3 0 1K 0 part └─sda5 8:5 0 391.6G 0 part / I'm having this type of ...
  • 117
0 votes
2 answers
133 views

How to wipe the contents of a linux swap parition?

I have a parition /dev/sda3 of type "linux-swap" (as shown by gparted). The partition is no longer in use and is also no longer an entry in /etc/fstab. But I am concerned because there could ...
  • 757
0 votes
1 answer
120 views

How to create a swap partition after instalation

I am running endeavourOS and I want to create a swap partition, I have already installed the OS but did not choose swap when I installed the OS. I tried to shrink a partition to make it into a swap ...
  • 23
0 votes
0 answers
215 views

rtcwake: write error and PM: Swap header not found!

When I run $sudo rtcwake -m disk -s 60, it shows: rtcwake: assuming RTC uses UTC ... rtcwake: wakeup from "disk" using /dev/rtc0 at Fri Jul 1 10:09:45 2022 rtcwake: write error I created a ...
0 votes
0 answers
133 views

Swap memory not working

I work on a workstation Precision 7920 Tower Workstation in which I had recently upgraded the RAM from 96 GB to 416 GB (previously it had 12 dimms of 8GB and I added 10 dimms of 32 GB each) while ...
  • 1
0 votes
1 answer
88 views

Swap is full, but processes barely use any of it

I have a Debian VM where after about a day (but sometimes sooner) all the swap gets used up (and consequently zabbix pesters me about it). I set swappiness to 0, but it still does this, albeit maybe a ...
  • 515
1 vote
1 answer
312 views

Is increasing the max_pool_percent parameter for zswap a smart idea to combine concepts of zram and zswap to increase memory and decrease disk usage?

I don't know if I'm missing something, but please take this with a grain of salt. So, zram is used to reduce I/O operations on the disk by making a swap on the memory which eliminates system freezes ...
  • 11
0 votes
0 answers
28 views

My swap is getting full and I don't know what's happening

RANGE SIZE STATE REMOVABLE BLOCK 0x0000000000000000-0x0000000087ffffff 2.1G online yes 0-16 0x0000000100000000-0x0000000477ffffff 13.9G online yes 32-...
1 vote
2 answers
264 views

Zero free swap but 56GiB free memory?

I have a CentOS7.9 system showing 56GiB free RAM (free -m) but only 1MiB free swap, and it's been in this state for three days. The original problem report was that a large (EE simulation) app keeps ...
-1 votes
1 answer
947 views

Can't add swap in pop Os 22.04

I have recently installed Pop OS 22.04 on my dell laptop. At the installation time I have chosen /dev/sda2 partition for my swap partition. But the installer gone mad and used /dev/sda2 and /dev/sda8, ...
0 votes
0 answers
62 views

How to limit swap usage without using sysctl or resizing the partition?

There is the following scenario: I have an HDD disk that uses LVM and I cannot resize the partitions in it, in this disk, there is a swap partition that is 10gb. I also use zram apart from disk based ...
1 vote
2 answers
376 views

Why k3s is still seeing swap on Debian Bullseye?

I've installed k3s on Debian Bullseye (on M1 Pro through qemu/UTM). k3s recommend to disable the swap. After reading the answers of the following questions: How to safely turn off swap permanently ...
0 votes
1 answer
405 views

How to get cache used per process on *nix systems

I would like to know, what is cache usage per process. Is there a way to do it? I'm currently on Ubuntu. The problem is, that my PC fills up whole cache, and then when I need RAM just starts swapping ...
5 votes
1 answer
525 views

Is swapped memory encrypted on encrypted partitions?

If I installed Ubuntu on an encrypted ext4 partition, I normally have a /swapfile. Now I would expect that the swapped memory is also encrypted by default. However, the man-page of swapon says: The ...
  • 181
2 votes
1 answer
753 views

What is the replacement of memory.swappiness file in cgroups v2

I'm currently migrating from cgroups v1 to cgroups v2. And I can't find the memory.swappiness file that I used in cgroups v1. There are only the following files concerning swap memory.swap.current ...
  • 107
0 votes
2 answers
851 views

What kind of content/data does "fallocate" command generate?

When is executed the sudo fallocate -l 2G /swapfile command, then 2 GB is created, but with that kind of content or data? Can be it customized? If yes How?. I did do some research but there are no ...
0 votes
0 answers
22 views

swap file: dd or fallocate? [duplicate]

About swap file in many tutorials within their procedures user either dd or fallocate dd as: sudo dd if=/dev/zero of=/swapfile bs=1024 count=N # N represents a high number to get X giga fallocate as:...
1 vote
1 answer
368 views

What should be in my /etc/fstab if I have two discs?

I have a laptop. It has two hard drives. One is an SSD with a normal Windows 10 install on it. The other is an mSata with a normal install of FreeBSD13 on it. To install FreeBSD I removed the SSD, ...
0 votes
2 answers
180 views

On Linux what is the technical minimum size for a functional swap partition

What is the technical minimum size for a functional (holds some pages) swap partition or file on Linux. If it's architecture dependent, or depends on the size of physical memory or something, how ...
  • 395
0 votes
0 answers
157 views

Running computations from SWAP without complete performance drop - Discussion on NVMe speeds and if they ever come in reach for RAM replacements

I have been setting up my Linux machine (currently pop-os) in several ways recently to upgrade my system to demands of specific data analysis done in R. In brief: The Data set I am working on is ...
-2 votes
2 answers
258 views

what is the different between settings swappiness to 0 to swapoff

we want to disable swap on all our rhel servers ( hadoop servers ) we have 2 options set swappiness to 0, and swapoff -a & swapon -a swapoff -a , and disable swap from fstab from my ...
  • 11.9k
3 votes
3 answers
941 views

Does swap on zram free backing pages when pages are unswapped from it?

Imagine a scenario where 2GiB is swapped out to zram and compresses down to 1GiB. Once the memory pressure is alleviated and the 2GiB gradually become unswapped, does Linux free the 1GiB of pages that ...
  • 500
1 vote
0 answers
232 views

linux + running swapoff and swapon on the background

We want to update the vm.swappiness from 10 to 1 and to perform swapoff and swapon , so the consuming of memory will be only from the memory cards and not from disk So we wrote the following bash ...
  • 11.9k
0 votes
0 answers
38 views

Is there any configuration that I can change to make the system kill a process when RAM memory is full?

I work on a computer with 32GB of RAM using Ubuntu 20.04. I often open some VirtualBox machines and keep a lot of stuff open at once. Sometimes I accidentally fill all the RAM memory on the computer ...
  • 341
0 votes
1 answer
294 views

Can't boot into my LUKS-encrypted Drive after deleting swapfile

My drive uses LVM and is LUKS encrypted (EFI). I am trying to get into my drive, but after I put in my password for the LUKS encryption, it hangs. I recently needed to add more memory to my root ...
2 votes
1 answer
76 views

Maximum number of swapfiles - kernel documentation bug?

I'm writing an article about swapfiles. I decided to check how many swapfiles can I create and use. According to man 2 swapon, I know that it should be 29 - https://man7.org/linux/man-pages/man2/...
0 votes
0 answers
40 views

Why swap still used? [duplicate]

My system has 72GB of RAM. My program ( build code ) uses about 7GB of RAM to build code. I don't understand why swap (HDD RAM) is still used? Since there is about 65GB of free memory.
  • 587
0 votes
0 answers
38 views

Is there a way to restrict use of swap to cases when otherwise the OOM-Killer would kick in? [duplicate]

Is there a way to completely restrict using swap if there are buffers/cache in use? And use swap only to prevent Out-Of-Memory Killer. Is there a way to forbid using swap if are there still buffers/...
1 vote
1 answer
3k views

mount(2) system call failed: No such file or directory

I cannot mount the swap subvolue. -> sudo mount -av / : ignored /home : already mounted mount: /swap: mount(2) system call failed: No such file or ...
  • 275
0 votes
1 answer
58 views

What's the purpose of initializing a swap file without a mount point? [closed]

The zram-generator's documentation states, If a mount point is not specified, the device will be initialized, but will not be used for anything. Why would anyone want to initialize a swap file ...
0 votes
0 answers
90 views

My Ubuntu + i3 freezes randomly without any log

I'm using Ubuntu server 21.10 with i3 along with Compton. Everything thing works fine, but sometimes (every 2 or 3 days) it freezes completely and no more action could be taken, nothing works and I ...
1 vote
1 answer
208 views

How to add encrypted swap file on FreeBSD 13

I want to add encrypted swap file in FreeBSD 13. I have read this documentation page, but it doesn't explain how to set up encryption for the swap file. I've also read another one, but it only gives ...
  • 171
0 votes
0 answers
955 views

"This disk is currently in use" - but nothing seems to be using it?

I am installing ArchLinux for the first time I made the corresponding partitions but for some reason when I want to do the swap or format them it tells me that it is busy. I deleted all the partitions ...

1
2 3 4 5
14