-----Original Message-----
From: Robert Moskowitz via users
Sent: Jul 31, 2026 12:38 PM
To: Community support for Fedora users
Cc: Robert Moskowitz
Subject: F44 - is there a way to shrink swap?
I had a runaway task that eat my memory all up, and barely was able to kill it while the system was swapping away trying to live. Now I see:
$ free
total used free shared buff/cache available
Mem: 16216428 12187636 395764 3895004 6469616 4028792
Swap: 8388604 4372300 4016304
Is there a way to shrink the current swap size, and increase how much is available for actual use/
Or is that what is happening with total mem being 16Gb, 12Gb used and 4Gb swap used? So the system is doing its best?
I probably should reboot before next weeks work....
Like what I am seeing with this Lenovo x260, but the memory is set at its max of 16gb.
Assuming you mean that you want to bring all swapped-out pages back into memory and not shrink the size of your swap file/partition, just temporarily turn off swap (assuming you have enough physical memory).
sudo swapoff -a && sudo swapon -a