LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-05-2019, 03:48 PM   #1
deretsigernu
Member
 
Registered: May 2007
Distribution: Slackware 14.2/-current
Posts: 185

Rep: Reputation: 13
SWAP partition size


I am trying to plan ahead for setting up a dual boot computer (Win 10 and one or more linux distro(s)) and as I read the methods, I see that the SWAP partition should be 1.5 - 2x the size of the computer's RAM. If my computer has 16 GB of RAM, I need to have a 24-32 GB RAM partition? I ask because this seems kind of excessive. If that's still the standard, I'll run with it, just want to be sure.
 
Old 05-05-2019, 03:51 PM   #2
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,407
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
SWAP partition size

If you want to hibernate your computer, it might help to have 2x the ram. Unless it is overkill.

Maybe you could say more on your planed usage of the said computer.
 
1 members found this post helpful.
Old 05-05-2019, 05:46 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
It's never been a "standard", simply a recommendation; and from a time when systems had much less RAM - megabytes, not gigabytes.
Even on my 8G laptops I allocate my standard 2G swap - handles hibernation fine for me, but those machines don't do any heavy processing. On my PCs where I do things like photo processing I also only allocate 2G swap - but they are always powered off not hibernated when I'm finished.
I picked 2G merely for convenience, feel free to pick your own. It will as Tonus suggests depend on your usage - my mantra is if you are using a lot of swap, something is wrong; might be as simple as needing more RAM, might be crappy code somewhere. If you don't use swap, it doesn't matter what size it is - Linux runs fine without swap at all if there is no memory constraint.
 
1 members found this post helpful.
Old 05-05-2019, 06:08 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
as they said, as well as I'd put your swap partition on the end tail, this way if you find yourself not needing as much or more it will be easier to take from or add to off of say your home partition, if you do a 3 partition scenario for Linux.
 
1 members found this post helpful.
Old 05-05-2019, 07:45 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,342
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
Just as an example, I have 16GB RAM and 4GB swap in this machine, and the swap is usually untouched.
 
1 members found this post helpful.
Old 05-06-2019, 12:55 AM   #6
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by frankbell View Post
Just as an example, I have 16GB RAM and 4GB swap in this machine, and the swap is usually untouched.
After 1 month uptime I find that only about 75 MB (out of the 4 GB swap available) has been used on my system. Unless you run HEAVY memory using programs (I know of one student that needed more then 100 GB of working space for his program) OR when you want to fully suspend your system (that needs "RAM size" of swap) I think you never will need more then a few GB of swap.
 
Old 05-07-2019, 05:19 PM   #7
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
This is quite a good article on swap space and suggested sizes:

https://opensource.com/article/18/9/...-linux-systems
 
Old 05-13-2019, 08:06 AM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by deretsigernu View Post
I am trying to plan ahead for setting up a dual boot computer (Win 10 and one or more linux distro(s)) and as I read the methods, I see that the SWAP partition should be 1.5 - 2x the size of the computer's RAM. If my computer has 16 GB of RAM, I need to have a 24-32 GB RAM partition? I ask because this seems kind of excessive. If that's still the standard, I'll run with it, just want to be sure.

This has been stated clearly and was a good standard back before the 64bit revolution in processing. Today unless the computer has >8G RAM, I cap my swap at 2G and almost never see the swap touched. Computers running less than 8G RAM I will slightly increase the size of swap to 3G and is the computer has 2G or less Ill increase the swap up to 4G.

Remember RAM >>> HDD speeds, the exception is if you are running a high end SSD and even then the FSB for the sATA port is typically slower/smaller than the bus for your RAM.

You are running 16G RAM and unless you will be running multiple VM's at the same time, you should be more than fine with a simple 2G swap partition that all of the distro's can access. You will need a different partition for the win10 paging file. Again for that you can manually resize once win10 is installed.
 
  


Reply

Tags
dual boot, swap



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions on Swap Partition, How did Anyone Pass This Along? Next Ubuntu No Swap Partition happydog500 Linux - Software 18 12-25-2016 12:37 PM
Would a Linux swap partition work as a FreeBSD swap partition? Froggy192 *BSD 11 07-27-2013 02:06 PM
Hard Drive Partition Management - Mandriva Double Partition with Swap File partition moshebagelfresser Linux - Hardware 2 05-23-2008 10:46 AM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 12:55 PM
fdisk partition size differs from mounted partition size jimieee Linux - General 3 10-15-2003 03:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration