Do I need a SWAP file or partition? (8GB RAM)

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
foxyfennec
Level 1
Level 1
Posts: 16
Joined: Thu Apr 19, 2012 2:27 pm

Do I need a SWAP file or partition? (8GB RAM)

Post by foxyfennec » Sat Apr 27, 2013 6:15 pm

I am wondering if I need one or not. I have never seen my RAM usage go over 3GB.

Though I haven't done anything intensive like encoding or gaming. I imagine swapfiles/partitions are for the days of 2gb ram being a large amount?

What other benefit could I have from a swapfile? Could I make an 8gb swapfile for hibernation and set swappiness to 0 somehow (does that mean swap isn't used at all and the swapfile is purely for hiberantion?)

User avatar
karlchen
Level 20
Level 20
Posts: 10852
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Do I need a SWAP file or partition? (8GB RAM)

Post by karlchen » Sat Apr 27, 2013 6:25 pm

Hello, foxyfennec.

Mint is not Windows. You do not create a swap file, but a swap partition. Use the programme GParted in order to do so. In case it has not been installed, install it.
I would recommend a swap space size of at least 8 GB, else your system cannot hibernate. Setting vm.swappiness=0 does not turn swapping off. It instructs the OS to use swap space only in case it runs out of RAM.

Kind regards,
Karl
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.22a 64-bit
Ubuntu 18.04.2 32-bit Mate Desktop, Total Commander 9.22a 32-bit
Windows? - 1 window in every room

pfeiffep
Level 2
Level 2
Posts: 92
Joined: Tue Apr 23, 2013 10:32 pm
Location: United States

Re: Do I need a SWAP file or partition? (8GB RAM)

Post by pfeiffep » Sat Apr 27, 2013 10:43 pm

foxyfennec wrote:I am wondering if I need one or not. I have never seen my RAM usage go over 3GB.

Though I haven't done anything intensive like encoding or gaming. I imagine swapfiles/partitions are for the days of 2gb ram being a large amount?

What other benefit could I have from a swapfile? Could I make an 8gb swapfile for hibernation and set swappiness to 0 somehow (does that mean swap isn't used at all and the swapfile is purely for hiberantion?)
You certainly can create a swap FILE see directions >>http://twigstechtips.blogspot.com/2011/ ... -file.html
Karl is stating the USUAL configuration, and if you have gparted or another partitioning utility you might be better off creating a swap partition.

Swapping might be necessary if you do video editing or other memory intensive applications. If you don't have swap defined and you do run out of memory you will loose your work.
If you want to understand more read here >> https://help.ubuntu.com/community/SwapFaq
HP Tower | Intel iCore 7 3.2Ghz | 12 Gb mem | SDD Win7 | HDD Ubuntu 13.04 & Mint 14 Cinnamon | USB HDD Ubuntu 13.10
Dell laptop | Intel celeron 1.5 Ghz | 2 Gb mem | HDD Ubuntu 13.04 | USB HDD Mint 14


Regards, Pete

User avatar
Hammer459
Level 1
Level 1
Posts: 41
Joined: Mon Oct 15, 2012 2:44 am
Location: Sundsvall, Sweden
Contact:

Re: Do I need a SWAP file or partition? (8GB RAM)

Post by Hammer459 » Sun Apr 28, 2013 4:16 am

Having a swap partition is necessary for hibernation and I think for suspend. It is also a safety precaution should you run out of RAM. However, Linux does not swap unless it has to, and with 8GB RAM that is not likely to happen often :)
So the answer is, technically you do not need it but I would VERY strongly recommend a swap partition of at least 8GB

foxyfennec
Level 1
Level 1
Posts: 16
Joined: Thu Apr 19, 2012 2:27 pm

Re: Do I need a SWAP file or partition? (8GB RAM)

Post by foxyfennec » Tue Apr 30, 2013 3:23 pm

I think I'll make a 8-16 GB one at the end of my disk when I have time to boot into a liveCD.

Is there no way to do it while the system is turned on? It is mounted as my /home. I'm sure I could modify partitions while logged in in Windows so surely Linux has a way?

User avatar
DrHu
Level 17
Level 17
Posts: 7539
Joined: Wed Jun 17, 2009 8:20 pm

Re: Do I need a SWAP file or partition? (8GB RAM)

Post by DrHu » Tue Apr 30, 2013 4:32 pm

You probably don't need one, unless you found that your application set + RAM usage was way too high, and slowing your system.

Even if a Mint default (standard install, using whole drive or partition area /) is creating a swap partition , you can rerun gparted on the logged in account (user), and delete the swap partition, resize your current partition (/) to take over that space, and finally edit /etc/fstab to comment out ( #) or if you are certain ofd your edit, remobve the swap line from that file.
http://www.dedoimedo.com/computers/gparted.html

Steensen
Level 1
Level 1
Posts: 21
Joined: Tue Jun 30, 2015 11:35 pm

Re: Do I need a SWAP file or partition? (8GB RAM)

Post by Steensen » Thu Jul 02, 2015 8:29 am

pfeiffep wrote: Swapping might be necessary if you do video editing or other memory intensive applications. If you don't have swap defined and you do run out of memory you will loose your work.
If you want to understand more read here >> https://help.ubuntu.com/community/SwapFaq
Thx. for that link. Very good guide/info for noobs like me and #0.
After reading that guide, almost anybody, no matter how little/mutch computer knowledge they have, are able to take the decision on how to run with swap, and how to change it from what they have now.
OS: Linux Mint 18.3-64-bit Cinamon
Laptop: Acer Predator 09-591-726M
CPU: Intel i7-6700HQ (2.6GHz), RAM: 16GB DDR4
GFX-1: Intel, GFX-2: NVIDIA GT 980M
476GB SDD; Win 10~240GB, /~220GB, swap~16GB
2TB HDD, DATA~2TB
Network: Kille AC-1535

Post Reply

Return to “Newbie Questions”