RetroFed Forum
Your home away from modern life.
Linux users, how much swap do you use?
Post Reply
AuthorMessage
Blaze piefed.zip Blaze@piefed.zip
Joined: 2025-06-13
Quote

2   Original
Sanctus anarchist.nexus Sanctus@anarchist.nexus
Joined: 2025-09-08
#2 · Quote Reply

Depends on the machine. My driver laptop matches swap with the RAM. My terminal buddy I really didnt give a shit about and its disabled. I'm building a Linux gaming rig and I'm not sure what I will do.

1
felsiq piefed.zip felsiq@piefed.zip
Joined: 2025-07-02
#3 · Quote Reply

On my daily driver gaming pc, none. I have 32gb of ram for the rare occasions I need more than 16, and I never use it all.

1
neidu3 sh.itjust.works neidu3@sh.itjust.works
Joined: 2024-11-03
#4 · Quote Reply

When I started dabbling with FreeBSD over 25 years ago the rule of thumb was to have swap space at least twice the size of your RAM. Then as time went in and I was no longer limited by 32MB, I made a habit of having the same swap space as RAM.

Nowadays it's kind of machine dependent for me. On my daily driver I have a swap partition of roughly half the amount of RAM I have, and the few times when that's not enough I can swapon some swap files on my root FS instead.

At work I stopped using a swap partition, as the 256GB of RAM I install as default won't run out any time soon. When oradb is having a stroke and starts eating up more than it should I add some swap files just to be safe.

1
Blaze piefed.zip Blaze@piefed.zip
Joined: 2025-06-13
#5 · Quote Reply

When I started dabbling with FreeBSD over 25 years ago the rule of thumb was to have swap space at least twice the size of your RAM. Then as time went in and I was no longer limited by 32MB, I made a habit of having the same swap space as RAM. Nowadays it's kind of machine dependent for me. On my daily driver I have a swap partition of roughly half the amount of RAM I have, and the few times wh...

On my daily driver I have a swap partition of roughly half the amount of RAM I have

That's probably what I should do. I have 16GB of RAM, 2GB of swap, the swap is constantly at full use.

Or maybe I should just add 16 GB of RAM 😅

1
Snot Flickerman lemmy.blahaj.zone SnotFlickerman@lemmy.blahaj.zone
Joined: 2023-10-24
#6 · Quote Reply

I have 32 gb of RAM but occasionally I run VMs in VMware for learning and experimentation. For good performance, I have about 16gb of swap on my NVMe so I can give a VM up to 8gb of RAM without quality degradation.

For a daily driver that's for gaming and web browsing, if you have 16gb of ram, you probably shouldn't have to alter your swap really.

1
Blaze piefed.zip Blaze@piefed.zip
Joined: 2025-06-13
#7 · Quote Reply

I have 32 gb of RAM but occasionally I run VMs in VMware for learning and experimentation. For good performance, I have about 16gb of swap on my NVMe so I can give a VM up to 8gb of RAM without quality degradation. For a daily driver that's for gaming and web browsing, if you have 16gb of ram, you probably shouldn't have to alter your swap really.

I have a few instances of Matrix web clients open in my browser, maybe that's where all the RAM goes 😅

1
Snot Flickerman lemmy.blahaj.zone SnotFlickerman@lemmy.blahaj.zone
Joined: 2023-10-24
#8 · Quote Reply

I have a few instances of Matrix web clients open in my browser, maybe that's where all the RAM goes 😅

Web browsers are notorious RAM hogs as it is, add several tabs with Matrix clients and yeah, that's probably where a fair amount of it is getting used up.

I suggest either having about half the amount of RAM you have for swap, and if you can spare it on your drive, the whole amount. In other words, if you have 16gb of RAM anywhere from 8gb-16gb if you can spare it. If you have less than 16gb, yeah, you're gonna want to open up as much swap as you can reasonably afford to on your drive.

I have two 1tb NVMes plus two other SSDs, so 16gb is a drop in the bucket for me. It may not be for you and your setup! Always do what makes the most sense within your personal limitations.

1
Blaze piefed.zip Blaze@piefed.zip
Joined: 2025-06-13
#9 · Quote Reply

Web browsers are notorious RAM hogs as it is, add several tabs with Matrix clients and yeah, that's probably where a fair amount of it is getting used up. I suggest either having about half the amount of RAM you have for swap, and if you can spare it on your drive, the whole amount. In other words, if you have 16gb of RAM anywhere from 8gb-16gb if you can spare it. If you have less than 16gb, y...

Sounds good, thank you for the advice. Do you use a swap file or a swap partition?

1
Snot Flickerman lemmy.blahaj.zone SnotFlickerman@lemmy.blahaj.zone
Joined: 2023-10-24
#10 · Quote Reply

Sounds good, thank you for the advice. Do you use a swap file or a swap partition?

I just use a swap file.

This is what I do to alter the size

#Disable swap
sudo swapoff /swapfile
#Increase the file swap size
#This is for 8gb, or 8192mb, change the 8192 to whatever best suits your purposes
sudo dd if=/dev/zero of=/swapfile bs=1M count=8192 oflag=append conv=notrunc
#Make the new file a swap file
sudo mkswap /swapfile
#Re-enable the swap
sudo swapon /swapfile
#Check to make sure it worked (Will be under "Swap total")
cat /proc/meminfo

I use Kubuntu (the horror!) so my commands are Debian-oriented. You may need to do it differently if you use Arch or something. Also mind that the bit oflag=append conv=notrunc appends to the original swapfile, I hardly know how to use dd, so I'm not sure of the flags for not appending.

1
neidu3 sh.itjust.works neidu3@sh.itjust.works
Joined: 2024-11-03
#11 · Quote Reply

On my daily driver I have a swap partition of roughly half the amount of RAM I have That's probably what I should do. I have 16GB of RAM, 2GB of swap, the swap is constantly at full use. Or maybe I should just add 16 GB of RAM 😅

I have 32GB of RAM which practically never runs out. I'm using a 16GB swap partition, but could've gotten away with much less. I think on the next install I'll just go with the same approach as I have at work servers: No swap partitions, swapon some files on the fly instead if I really need to.

1
Cosmonaut_Collin lemmy.world Cosmonaut_Collin@lemmy.world
Joined: 2023-06-10
#12 · Quote Reply

I have an 8gb swap file for Star citizen.

1
Maestro fedia.io Maestro@fedia.io
Joined: 2024-03-17
#13 · Quote Reply

I use 1.5x RAM, so 48GB on my work laptop. That way hibernate (suspend to disk) works properly. If you never hibernate you can get away with less or no swap.

1
Blaze piefed.zip Blaze@piefed.zip
Joined: 2025-06-13
#14 · Quote Reply

I just use a swap file. This is what I do to alter the size #Disable swap sudo swapoff /swapfile #Increase the file swap size #This is for 8gb, or 8192mb, change the 8192 to whatever best suits your purposes sudo dd if=/dev/zero of=/swapfile bs=1M count=8192 oflag=append conv=notrunc #Make the new file a swap file sudo mkswap /swapfile #Re-enable the swap sudo swapon /swapfile #Check to make su...

Thanks!

1
HorreC lemmy.world HorreC@lemmy.world
Joined: 2024-06-28
#15 · Quote Reply

On my daily driver gaming pc, none. I have 32gb of ram for the rare occasions I need more than 16, and I never use it all.

Some older games required swap space (they just hard coded it) so I just run 8GB of swap, its never used but for a few older titles (the sims series was really bad for it) and its not like I am ganna require 8GB out of the 4TB SSD.

1
swelter_spark reddthat.com swelter_spark@reddthat.com
Joined: 2025-03-06
#16 · Quote Reply

I have 32 Gb but I'm not sure how much of that has ever been used.

1
Post Reply
Back to top