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.
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.
#Disable swapsudo swapoff /swapfile
#Increase the file swap size#This is for 8gb, or 8192mb, change the 8192 to whatever best suits your purposessudoddif=/dev/zero of=/swapfile bs=1M count=8192 oflag=append conv=notrunc
#Make the new file a swap filesudo mkswap /swapfile
#Re-enable the swapsudo 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.
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 😅
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.
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/meminfoI 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=notruncappends to the original swapfile, I hardly know how to use dd, so I’m not sure of the flags for not appending.Thanks!