1

There are lot of similar questions and I have read many answers and have tried many things, nothing has helped so far.

My machine suddenly becomes slow. Practical observation is when it reaches around 50% of RAM usage, performance of the machine becomes unbearable.

I have 16GB of RAM and 16GB of swap. As far as I can see, swap is not at used. It takes around 5-10 seconds for any action - mouse click or simple application switch using alt-tab. It does respond, eventually.

This is primary work machine and I usually have two eclipse instances running Java 1.8 and Java 11 respectively, chromium browser and few other applications such as emacs, terminal and sometimes firefox. In the background, mysql is usually running.

Top and IOTop does not show any activities going on, but many times, both the applications also freeze.

There are no entries in any of the log files about potential problems. I can try to provide any other relevant data if needed. Machine is up to date for service pack updates.

I can understand it won't use swap if not needed, but not able to resolve unresponsive machine problem. As said earlier, it usually happens when memory usage goes to 50+% of the memory. Switching the applications or even typing in editor are becoming slow performing tasks now.

Output of free command

free -h
total        used        free      shared  buff/cache   available
Mem:            15G        5.6G        6.9G        481M        3.0G        9.1G
Swap:           15G          0B         15G

fstab

enter image description here

blkid

enter image description here

Edits to provide information as requested. Images are taken after I posted the question. I'm trying now with a new disk attached in addition to previous one. Swappiness is increased and will monitor the effect

  • 1
    Are you using a /swapfile, or a swap partition? Show me a screenshot of gparted and sudo blkid and cat /etc/fstab. For testing purposes, try sudo sysctl vm.swappiness=80 and see if that helps. Monitor free -h. Set it back to 60 if it doesn't help. – heynnema Sep 24 at 18:38
  • 1
    @heynnema, added information as requested – user871199 Sep 24 at 19:29
  • 1
    Oh, you have two swap areas. Show me ls -al /var/swapfile and show me a screenshot of gparted, as requested earlier. – heynnema Sep 24 at 19:36
  • status please... – heynnema Sep 25 at 15:16
  • @heynnema, I'll get back to you in next hour or so. Thank you for the help – user871199 Sep 25 at 17:21
1

It looks like you may have a swap problem. You have BOTH a /var/swapfile AND a swap partition. That's not a problem in as itself, unless the sizes are not correctly set (unknown at this time), or the fstab entries are incorrect (as yours is).

Assuming that /dev/sda5 is at least 4G, as seen by gparted or sudo fdisk -l, we'll modify your swap configuration.

First we'll modify /etc/fstab.

In the terminal app...

sudo -H gedit /etc/fstab # edit fstab

change this...

/var/swapfile none swap defaults 0 0

to this...

/var/swapfile none swap sw 0 0

then to this...

#/var/swapfile none swap sw 0 0

save the file and quit gedit.

reboot

sudo sysctl vm.swappiness # should show a value of 60 after a reboot.

free -h # check swap size

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.