With all this memory work I have been doing I finally noticed that free was reporting 24GB swap:
# free total used free shared buff/cache available Mem: 15625916 7018872 6765700 109108 1841344 8162532 Swap: 25165816 0 25165816
Thing is I only have 16GB in my swap partition:
# fdisk -l /dev/sda Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors Disk model: WDC WDBNCE5000PN Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xa3fd40f9
Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 2099199 2097152 1G 83 Linux /dev/sda2 2099200 148899839 146800640 70G 83 Linux /dev/sda3 148899840 182454271 33554432 16G 82 Linux swap / Solaris /dev/sda4 182454272 976773119 794318848 378.8G 5 Extended /dev/sda5 182456320 976773119 794316800 378.8G 83 Linux
OK. What is happening. I remember Ed's comment about him using zram, so I did some digging and find:
# swapon --show NAME TYPE SIZE USED PRIO /dev/sda3 partition 16G 0B -2 /dev/zram0 partition 8G 0B 100
Um, I did not know I set up zram? How did that happen. Is zram now part of the basic Fedora install?
It has been a while my using zram. How do I disable it for now? With 16GB real memory and 16GB real swap partition, I want to see how things are working...
thanks
On Sun, 2022-01-16 at 11:46 -0500, Robert Moskowitz wrote:
OK. What is happening. I remember Ed's comment about him using zram, so I did some digging and find:
# swapon --show NAME TYPE SIZE USED PRIO /dev/sda3 partition 16G 0B -2 /dev/zram0 partition 8G 0B 100
Um, I did not know I set up zram? How did that happen. Is zram now part of the basic Fedora install?
It's the default now.
poc
Um, I did not know I set up zram? How did that happen. Is zram now part of the basic Fedora install?
It has been a while my using zram. How do I disable it for now? With 16GB real memory and 16GB real swap partition, I want to see how things are working...
thanks
https://fedoraproject.org/wiki/Changes/SwapOnZRAM
Immediately: sudo systemctl stop swap-create@zram0
Permanently: sudo touch /etc/systemd/zram-generator.conf or sudo dnf remove zram-generator-defaults
On 1/16/22 11:53, Grumpey wrote:
Um, I did not know I set up zram? How did that happen. Is zram now part of the basic Fedora install?
It has been a while my using zram. How do I disable it for now? With 16GB real memory and 16GB real swap partition, I want to see how things are working...
thanks
Grumble. So this became the default in F33, and I jumped from F32 to F35, so I missed the excitement. Only now to find out the change.
If I had 'known' this, I would have looked at my memory/performance issue differently. I WAS showing 5Gb memory used and ~5GB swap used back when I started this thread on the 11th:
$ free total used free shared buff/cache available Mem: 7380668 5146100 1776840 1364 457728 1948864 Swap: 24157176 5270956 18886220
At that time, I had significant system delays when doing various tasks. Looking back, I will attribute this to zram operations.
Immediately: sudo systemctl stop swap-create@zram0
Permanently: sudo touch /etc/systemd/zram-generator.conf or sudo dnf remove zram-generator-defaults
As of now, I am seeing zero swap used and zramctl being small:
# zramctl NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT /dev/zram0 lzo-rle 8G 4K 80B 12K 4 [SWAP]
So I will wait a few days and see how growing Firefox impacts all of this with the additional 8GB real memory...
thanks
On 2022-01-16 11:53 a.m., Grumpey wrote:
Um, I did not know I set up zram? How did that happen. Is zram now part of the basic Fedora install?
It has been a while my using zram. How do I disable it for now? With 16GB real memory and 16GB real swap partition, I want to see how things are working...
thanks
https://fedoraproject.org/wiki/Changes/SwapOnZRAM
Immediately: sudo systemctl stop swap-create@zram0
Permanently: sudo touch /etc/systemd/zram-generator.conf or sudo dnf remove zram-generator-defaults
Asking the interesting question: Why would you want to ever do this? RAM is ~10x faster than SSD and 100x faster than spinning disk. Unless your system is so ancient and CPU-constrained that you are unable to afford the relatively low compression costs, making use of all available RAM at all times seems like a better move than stopping ZRAM swap.
--
John Mellor
On 1/16/22 15:03, John Mellor wrote:
On 2022-01-16 11:53 a.m., Grumpey wrote:
Um, I did not know I set up zram? How did that happen. Is zram now part of the basic Fedora install?
It has been a while my using zram. How do I disable it for now? With 16GB real memory and 16GB real swap partition, I want to see how things are working...
thanks
https://fedoraproject.org/wiki/Changes/SwapOnZRAM
Immediately: sudo systemctl stop swap-create@zram0
Permanently: sudo touch /etc/systemd/zram-generator.conf or sudo dnf remove zram-generator-defaults
Asking the interesting question: Why would you want to ever do this? RAM is ~10x faster than SSD and 100x faster than spinning disk. Unless your system is so ancient and CPU-constrained that you are unable to afford the relatively low compression costs, making use of all available RAM at all times seems like a better move than stopping ZRAM swap.
For what it is worth....
Prior to my memory upgrade, when I had only 8GB memory and Firefox just growing, I was seeing the following:
$ free total used free shared buff/cache available Mem: 7380668 6930852 262676 1492 187140 221144 Swap: 24157176 12044096 12113080
I did not know then about zram being the default, so I don't know how much of that 12GB swap was zram and how much was SSD.
But I can tell you that my system regularly 'hesitated' when I switched tasks. I had real wait time before I could do something. And at times I would be typing and the system did not respond. I had to wait a couple seconds before the screen was updated with whatever I was typing. Now this is on a Lenovo x140e with an SSD drive, using Xfce; granted an older platform but quad-core. Since the memory upgrade, there has been none of this hesitation. And I am right now seeing:
free total used free shared buff/cache available Mem: 15625916 10489292 598484 183664 4538140 4617552 Swap: 25165816 512 25165304
zramctl NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT /dev/zram0 lzo-rle 8G 496K 122.1K 380K 4 [SWAP]
this is after being running only 21hr. We will see how the system is doing in a few days, but swap was killing me. Was it real SSD r/w or zram compression?
On 1/16/22 15:03, John Mellor wrote:
On 2022-01-16 11:53 a.m., Grumpey wrote:
Um, I did not know I set up zram? How did that happen. Is zram now part of the basic Fedora install?
It has been a while my using zram. How do I disable it for now? With 16GB real memory and 16GB real swap partition, I want to see how things are working...
thanks
https://fedoraproject.org/wiki/Changes/SwapOnZRAM
Immediately: sudo systemctl stop swap-create@zram0
Permanently: sudo touch /etc/systemd/zram-generator.conf or sudo dnf remove zram-generator-defaults
Asking the interesting question: Why would you want to ever do this? RAM is ~10x faster than SSD and 100x faster than spinning disk. Unless your system is so ancient and CPU-constrained that you are unable to afford the relatively low compression costs, making use of all available RAM at all times seems like a better move than stopping ZRAM swap.
For what it is worth....
Prior to my memory upgrade, when I had only 8GB memory and Firefox just growing, I was seeing the following:
$ free total used free shared buff/cache available Mem: 7380668 6930852 262676 1492 187140 221144 Swap: 24157176 12044096 12113080
I did not know then about zram being the default, so I don't know how much of that 12GB swap was zram and how much was SSD.
But I can tell you that my system regularly 'hesitated' when I switched tasks. I had real wait time before I could do something. And at times I would be typing and the system did not respond. I had to wait a couple seconds before the screen was updated with whatever I was typing. Now this is on a Lenovo x140e with an SSD drive, using Xfce; granted an older platform but quad-core. Since the memory upgrade, there has been none of this hesitation. And I am right now seeing:
free total used free shared buff/cache available Mem: 15625916 10489292 598484 183664 4538140 4617552 Swap: 25165816 512 25165304
zramctl NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT /dev/zram0 lzo-rle 8G 496K 122.1K 380K 4 [SWAP]
this is after being running only 21hr. We will see how the system is doing in a few days, but swap was killing me. Was it real SSD r/w or zram compression?
On Sun, Jan 16, 2022 at 10:46 AM Robert Moskowitz rgm@htt-consult.com wrote:
It has been a while my using zram. How do I disable it for now? With 16GB real memory and 16GB real swap partition, I want to see how things are working...
While someone provided the direct answer to your question, I would reverse it. What are you doing that would require that much disk swap? And even if it did the performance would be pretty bad unless you're running an SSD/NVMe drive, and even if you are, in memory swap would still be faster.
Also, now that processes are killed automatically in OOM situations having large amounts of swap isn't really necessary.
At the end of the day it's all about the problem you want to deal with:
1. Large physical swap which may prevent OOM but your system slows to a crawl to the point of being unusable (but possibly recoverable) if you're very patient. 2. zram swap + OOM killer which may choose the wrong process to kill but keeps your system responsive.
For me, the only time I max out my memory (32GB real, ~48GB w/ zram swap) is when building very large packages. If I was to use disk swap that would significantly slow down an already large/long build so I prefer option #2.
Thanks, Richard
On Sun, 2022-01-16 at 11:11 -0600, Richard Shaw wrote:
What are you doing that would require that much disk swap? And even if it did the performance would be pretty bad unless you're running an SSD/NVMe drive, and even if you are, in memory swap would still be faster.
With me, I can only ever recall paging going troppo when some badly written website triggers some flaw in my web browser, or a media player failing to cope with a badly encoded video file. They're the only two things I can ever remember triggering mad swapping. It can be murder trying to fix that without hard resetting the computer hardware.
If I'm lucky I notice it quickly, and CTRL ALT BACKSPACE to kill X, as about the only thing that responds to me. Even moving the mouse pointer is like trying to run the mouse over a corrugated iron mousepad with a severely delayed response on screen.
But if I don't notice it quickly, it could spend hours with the CPU fans blasting at full speed as it tries to divide the universe by zero before doing anything else.