1

After I upgraded from HDD to SSD, I followed some tips from Internet and turned swap off, but then, my OS would always freeze when out of memory although I have 8GB RAM and just open some applications.

Today I decide to turn swap on to get my system working better. Are there any better solutions for my case?

Zanna
  • 70,465
  • 1
    Are you hibernating your machine? This requires the SWAP partition. Other than that, you should technically be fine without it. 8GB of RAM certainly isn't a small amount. You shouldn't run out of memory running only a few programs. I don't even have a SWAP partition on my machine and everything runs fine. – cP4n Mar 26 '17 at 15:09
  • 1
    Normally 8 GB RAM should be more than enough, but it depends on your user habits. It could be a good solution to have a small swap partition, 1 or 2 GB. When the computer is getting slow, you can suspect that it starts swapping, and then you should turn off some program or close some tabs in your browser. – sudodus Mar 26 '17 at 16:27
  • I think I didn't turn swap off safely and this issue was coming, because when I try to install Linux to a virtual machine with 2GB RAM, no swap partition and the system was working fine. This is step that I turn off swap:
    • Runt this command: sudo swapoff -a
    • Disable mount swap partition on /etc/fstab
    • Delete swap partition with Gparted.
    – Ngọc Lương Mar 27 '17 at 02:25
  • What you describe should be enough. Actually it should be enough to remove or 'comment out' the line specifying swap in /etc/fstab and reboot. After that swap should not be used (even if there is a swap partition). I suspect that your system or some application program you are using 'eats' a lot of RAM. You can run a monitor program, for example htop to see how much RAM is used, and that way find out what might cause the system to run out of memory and freeze. – sudodus Mar 27 '17 at 11:52

0 Answers0