To swap or not to swap, that is the question.

Discussion in 'all things UNIX' started by bellgamin, Jan 31, 2022.

  1. bellgamin

    bellgamin Registered Member

    Joined:
    Aug 1, 2002
    Posts:
    8,123
    Location:
    Hawaii
    When installing EndeavorOS it asked which of the following I wanted:
    A- a swap file
    B- a swap partition
    C- no swap at all

    I chose A (a swap file) because I had to choose something, right?

    QUESTION: Which option should I have chosen, & why?
     
  2. Gringo95

    Gringo95 Registered Member

    Joined:
    May 7, 2009
    Posts:
    216
    A swap partition is as it suggests a separate physical partition on your hard drive or SSD. A swap file can replace this if there isn’t any physical space left to create a partition but this method is generally not recommended unless absolutely necessary. No swap would be fine for most Linux systems with 8G RAM+ unless you need hibernate which might complicate things although there are other options to deal with this scenario. IMO despite the various arguments either way selecting a swap partition at least equal to your RAM size is the best option.
     
  3. reasonablePrivacy

    reasonablePrivacy Registered Member

    Joined:
    Oct 7, 2017
    Posts:
    2,222
    Location:
    Member state of European Union
    I agree with Gring95. It depends on how much RAM computer has, how many RAM will be used and whether hibernation will be used.
    Swap partition is probably best option for people who are not sure.
    Around half RAM size provided you do not plant to use hibernation.
    Slightly more than RAM size if you plan to use hibernation. Some say around 130% of RAM size, some 150%, some other (100%*RAM size + 1GB).
     
  4. bellgamin

    bellgamin Registered Member

    Joined:
    Aug 1, 2002
    Posts:
    8,123
    Location:
    Hawaii
    Much thanks to you both. :-*

    I have tried out several Distros over the past few weeks. As far as I recall, EndeavorOS is the first Distro whose installer asked me about a swap file. Interesting, wot?
     
  5. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,561
    Location:
    NSW, Australia
    I've run Linux OS with and without Swap partitions. Multi-booting on the same drive. Practically, performance is identical. At least in my computers.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.