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
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' | ...
  • 407
0 votes
2 answers
28 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
15 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
54 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, ...
  • 211
0 votes
2 answers
89 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
287 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
33 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 ...
  • 107
0 votes
2 answers
59 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 ...
  • 393
0 votes
1 answer
49 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 ...
  • 21
0 votes
0 answers
61 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
44 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
43 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 ...
  • 495
0 votes
1 answer
79 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 ...
  • 1
0 votes
0 answers
27 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
72 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
370 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
41 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
193 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
115 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
272 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
324 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
450 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
229 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
89 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
62 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 ...
-3 votes
1 answer
80 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.4k
3 votes
3 answers
709 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 ...
  • 470
1 vote
0 answers
171 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.4k
0 votes
0 answers
34 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 ...
  • 319
0 votes
1 answer
208 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
69 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.
  • 333
0 votes
0 answers
37 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/...
0 votes
0 answers
24 views

How to log hardware usage stats for some time and get peak swap usage?

I'm building Android frequently and I need to figure out peak swap usage during build process. How I can do that?
  • 47
0 votes
1 answer
2k 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 ...
  • 245
0 votes
1 answer
47 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
68 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
159 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 ...
  • 161
0 votes
0 answers
432 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 ...
0 votes
2 answers
746 views

parted: create swap partition on gpt disk (one liner) not working

I am trying to create a swap partition in my script using parted based on the Arch Linux guidance. https://wiki.archlinux.org/title/Parted#Partition_schemes Somehow it is always sort of skipping the ...
1 vote
0 answers
104 views

GNU/Linux starts swapping with 50% RAM available

Recently (like 1-2 months ago) my laptop has started to become sluggish for short periods (~1 minute). It is due to kswapd. I would love it if kswapd preemptively slowly freed up RAM in the background,...
  • 30.7k
0 votes
0 answers
35 views

If I disable swap on linux will it open up the possibility for a hard reboot?

I know the OOM killer is invoked when out of memory. And this answer here: https://askubuntu.com/questions/440326/how-can-i-turn-off-swap-permanently says that it can potentially cause a hard reboot. ...
  • 101
3 votes
1 answer
373 views

How does the kernel decide between disk-cache vs swap?

Following on from topics raised in other questions, I believe that when the Linux Kernel is trying to free up physical RAM it makes some kind of decision between discarding pages from its disk cache ...
0 votes
1 answer
44 views

Centos release 7.3.1611 Extend Swap partition from current 1GB to 2GB

Could someone who has a deep knowledge can try explain how to achieve and increase a swap memory from 1 to 2G? I'm running Centos on Oracle Virtualbox. After utilized a command lsblk : sda ...
's user avatar
0 votes
0 answers
47 views

Swap space not being used effectively

I am using Parabola Linux (variant of Arch) on a Macbook Pro laptop. I have 8 GB of RAM and 8 GB of swap space set up. As far as I can see, the swap space is enabled and working; however, it seems it ...
  • 2,204
0 votes
1 answer
131 views

Will Clonezilla ignore my swapfile when saving a disk?

I have a PC with 32GBs of RAM running Linux Mint 20. As per instructions found here (which were meant for 19, but appear to work for 20), I have increased my swapfile to just a little larger than my ...
2 votes
1 answer
941 views

Cannot disable swap

I have a freshly installed fedora system, and I am struggling to turn off swap. I have checked /etc/fstab and there are no mentions of a swap partition there. I can turn swap off with swapoff -a but ...
  • 123
0 votes
0 answers
46 views

Wanted to expand main partition but accidentally deleted swap and expanded using that space too

This is a centos 7 vm running on hyperv. Two weeks ago I wanted to increase the root partition space. what I had is: dev/sda1 - boot dev/sda2 - swap dev/sda3 - root By mistake i used fdisk to delete ...
-1 votes
1 answer
66 views

Questions about swap [closed]

My PC - I am using Ubuntu 20.04 on my old potato pc to get it working. It has 2GB of RAM and an Intel i5 processor. I know it is really old, but I want to get this working. Problem in detail- I only ...
  • 162

1
2 3 4 5
14