0

I am using Lubuntu 20.04 on laptop with 4 GB of RAM. The problem is outlined in the title. I need to work with a few programs running simultaneously and one of them is known to be a memory hog.

Gradually, all memory becomes consumed. I realise the system has every «right» to behave badly in this situation, but the fact it freezes completely with almost no warning signs is somewhat frustrating to say the least. I would expect some intensive swapping with the HD, general slowing down, issuing some critical warnings. Something! Not the case, it simply stops responding with swift resolve.

How can it be battled? Any option would be better than hard resetting, would it?

10
  • 1
    Intense swapping may look like a complete freeze. The only good way is to install more RAM. You can use zswap to improve the situation a little, but still you need more RAM.
    – Pilot6
    Jan 21, 2021 at 17:36
  • @Pilot6 You are correct. Upgrading memory would be the answer. That was my first thought. Unfortunately, there are reasons, why I can't do it at the moment. On the second thought, would it really be the answer? The same situation would take place, when additional memory is consumed too. I don't quite understand why the OS fails to notify me about the fact it runs out of memory. After all the situation is not something unheard of. There must be some utilities monitoring RAM. Then I could kill and restart the hog (not perfect, because some calculations will be lost, but still beats hard reset).
    – S. N.
    Jan 21, 2021 at 17:53
  • @S.N. you can run topin a terminal, to see info on cpu and memory usage for processes. See man top' on how to sort on memory usage instead of (default) cpu-usage.? free` can show you the overall memory and swap usage.
    – Soren A
    Jan 21, 2021 at 18:17
  • 2
    Swapping may indeed be your problem. Edit your question and show me free -h and grep -i swap /etc/fstab.
    – heynnema
    Jan 21, 2021 at 18:17
  • Do you have swap enabled? A default install of Lubuntu 20.04 LTS doesn't have swap enabled/setup (though it allows you to set it up yourself, and will use swap partition if already present). I needed to borrow 4GB from a 8GB box, and didn't expect to notice any slow down in performance, but quickly did... enabling swap fixed that issue for me (until the RAM could be returned). @heynnema's answer here may help askubuntu.com/questions/1274118/…
    – guiverc
    Jan 21, 2021 at 22:27

1 Answer 1

0

The solution for my problem is described here as pointed out by @guiverc. Indeed, the swap was off (top -h gave all zeros). I has re-created it following the detailed instructions outlined in @heynnema 's answer and it is working as expected after reboot. I have not experienced any RAM-related problems since then.

The credit for resolving the issue goes entirely to @heynnema and @guiverc.

Not the answer you're looking for? Browse other questions tagged .