[list=]hi
I have 6Gb of ram i was thinking what if i go without a swap memory does this is a good idea. Does this effect the performance or will it creates system destabilize the system
Youāll probably encounter a lot of different opinions on that one ⦠e.g. this video strongly recommends using swap due to some software that expects it and will not be stable without it, but personally I have not encountered any case where swap was really needed if you otherwise have enough RAM.
Currently I run Ubuntu MATE 16.04 with 8 GB RAM swap-less, and havenāt had any issues.
One thing you definitely do give up if you decide to go without a swap partition is the ability to suspend to disk, which is probably more of an issue for portable machines than desktops.
Hi @Rasitha,
even with a large amount of RAM; you should at least have 1GB swap for that just in case scenario!. (Just my opinion!).
With most if not all Linux systems 2GB swap is recommended and I would not install a distribution with out one. If you choose not to add a swap partition you may run into trouble
Hi
i just recently went from 14.04 to 16.04 with clean install with that i made a little research on this topic i have 16GB ram and I run 14.04 was without swap there I had some difficulties when VM was running now on 16.04 i have 4 GB SWAP no problem on VMās
Iāve 6gb of RAM, and just have a swap file instead of a swap partition⦠although the swap file has never been used by any application. The reason I prefer a swap file is to make it easier to clone installations - I use Timeshift to clone my complete (including the swap file) installation to other Laptops/Desktops⦠I only ever install one OS, my other boxes use clones of it (and I have USB drives with the cloned OS too). Linux doesnāt work like Windows, so unless you use/need proprietary drivers for the clone target, all hardware is detected during each boot.
For those interested, hereās how to set up a 2gb swap file:
("/swapfile" is the path/name of the swap file, and ā2097152ā is the size in kilobytes (i.e. 2GB).)
dd if=/dev/zero of=/swapfile bs=1024 count=2097152
(Prepare the swap file)
mkswap /swapfile
Mount it
swapon /swapfile
Finally, add the following to /etc/fstab
/swapfile none swap sw 0 0
Reboot and you have a 2gb swap file.
Iāve been running without swap on my 4GB RAM laptop for a āveryā long time. With no adverse side-affects. Many people say to use swap because of ābetter safe than sorryā attitudes, but really if you have more than 6GB RAM, better not to use swap, on a consumer computer itāll be wasted space.
Itās more useful to think to yourself ādo I ever use more than 4GB in my day-day computing?ā if no, then you wonāt ever use the swap.
Pros:
- System wonāt totally crash if out of memory.
- System is more efficient when using the memory as cache.
- Good for low-RAM systems.
- Particularly the case with large file transfers.
Cons:
- Reserves a bit of hard disk space (swap partition or file)
- System degrades performance if the system swaps a lot on a mechanical HDD.
I have 16 GB of RAM, with a 2 GB swap at the end of my data drive. Itās there if needs it.
In most cases, itās hardly ever used, but itās available if memory management decides to be slightly more efficient by swapping, like:
- Copying large files, files are cached in RAM - if thereās unused background programs, they would temporarily move to swap.
- Running out of memory (for me, unlikely
), then swap prevents the system from freezing up.
I also use my RAM as a RAM disk (at /tmp
) for temporary files, so if I go over the limits, swap provides a bit of breathing space.
So if it was under 4 GB of RAM, Iād definitely keep swap. If itās over 4 GB, then itās up to you and whether youāll use all your RAM for your computing applications.
Swap is used for sleep and hibernate, and as a safety factor is one of your applications runs out of memory.
An example - your edit a rather long video track and add a music track along with a narration track
If you don't sleep or hibernate you system I suggest using a small amount of swap ... really won't slow your system down when not being used and is a good safetey net
Desktop:
24G ram
2G swap
Swappiness=0
The swap never kicks in.
Laptop:
4G ram
4G swap
Swappiness=0
Cache_pressure=60
Swap very very rarely kicks in with the added settings.
Is this a laptop? You may want to hibernate and then your swap partition needs to be the size (6G) of your ram. And these days 6G of space on a HDD is no big deal.
I for one never sleep or hibernate, any of my machines Iām on them to much for this action but some people feel the need for this although I did test the suspend mode and my machine did not we up
Hi guys. I have Ubuntu mate in my computer with 1 GB of swap, 4 GB of RAM, doing well and not if you use it in any APP, but I also have Ubuntu Mate installed in a micro sd card, this will have no swap, works very well and it has only failed me once when UM was suspended, refused to restart, then I canceled the suspension. It is my Ubuntu Mate laptop, I put it on any computer and have my private things, someday tell you how an installation is done on a micro sd, greetings ā¦