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?

S. N.
  • 305
  • 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 '21 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 '21 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 '21 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 '21 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 https://askubuntu.com/questions/1274118/why-lubuntu-20-04-is-running-slow-when-i-use-opera-or-libreoffice – guiverc Jan 21 '21 at 22:27
  • @guiverc Yes, it does! I have already mentioned it in the answer that I wrote to make it easier for those who read it later to get the idea on how to fix. Thank you for this link! – S. N. Jan 22 '21 at 10:50
  • @guiverc The only thing I still don't understand is why swapping is not enabled by default. It would be so logical to have it on it did not occur to me swapping could be disabled. But, I suppose, this question should be addressed to some one on the Lubuntu team, rather than to you. – S. N. Jan 22 '21 at 10:57
  • There are a number of reasons for that, part of it was that until very recently, the installer calamares didn't have any capacity to deal with swap (the later version used for hirsute now has a swap pull down! just no selection of size, but it's a start!; as of 8-Jan-2021).. also a number of users actually didn't want swap (they have loads of RAM, I'm not in that camp though - I want swap). Incidentally you did it address it to a Lubuntu team member :) – guiverc Jan 22 '21 at 11:24
  • @guiverc Good to know, thank you again. – S. N. Jan 22 '21 at 11:45
  • FYI: calamares on all releases used by Lubuntu (ie. 18.10 up) could deal with swap if manually setup (ie. manual partitioning options), the easy option of a drop-down to enable/disable swap is what was missing (`calamares defaults to no swap all releases up to and including groovy; maybe still today - only we now have the drop down to enable it..) There are people who don't need swap.... – guiverc Jan 22 '21 at 11:51

1 Answers1

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.

S. N.
  • 305