Score:1

How do I fix high memory usage on Ubuntu 20.04.3 LTS?

cn flag

Ubuntu 20.04.3 LTS is using a lot of memory, (10.1GB out of 12GB of RAM). The RAM fills up over time and reaches dangerously high levels of usage, even when I am using only 2 applications.

I've tried to follow the other suggestions posted on this forum about similar issues. I've run htop and top but they don't return useful information, ie it shows Chrome and Discord using the most amount of RAM - just 2-4% each. Java, MySQL, Apache, I've read are usually the culprits of high RAM usage, but Java isn't even running, and the other listed processes are barely using 0.1% of RAM.

Another thing I've noticed is, upon closing Chrome, the memory usage instantly drops from 10.1GB to only 1.7-2GB of usage. I dont understand this because according to htop, Chrome is using only 2% or so of memory.

2-4% should not be hogging up the entire memory, so I ran free -m and found out that buff/cache and shared usage is very high - 8.8GB and 7.2GB respectively. What are these and why are they using up so much memory? The system freezes and behaves very slowly during use. CPU usage is not very high either - hitting a max of 22% occasionally.

Here are my free -m results

free -m

On opening System Monitor,

System Monitor

My htop and top results respectively,

htop

top

As mentioned before, I'm running Ubuntu 20.04.3 LTS. Kernel version is 5.11.0-41-generic

Please help. My computer is becoming increasingly difficult to use.

Devvrath avatar
cn flag
@someone Well to be honest, I haven't had this problem before. I used to use 20.04 before there were some disk corruptions and I had to reinstall the operating system fresh. I've only faced this issue after the reinstall but I can't understand how because I'm using the same programs that I used before the reinstall. I don't understand how swap memory is suddenly become an issue when I never had this kind of problem before
us flag
Open the processes tab in system monitor, and check which process consumes the highest memory.
Devvrath avatar
cn flag
@ArchismanPanigrahi Chrome, with about 329MB (while using 12 tabs, but I've never had this issue of high memory usage before, even while using 20 tabs)
Someone avatar
my flag
ok, so IDT swap willl work
hu flag
Look at the `VIRT` collomn. There is a lot of cached stuff there.
vanadium avatar
cn flag
You will have to debug yourself: it seems that something is filling cache memory. Reboot your system, open `top` and set the terminal on top, then use your computer and keep an eye on what happens. That may allow you to identify when it happens.
Devvrath avatar
cn flag
Alright @vanadium I will try this and get back
Devvrath avatar
cn flag
Alright, I tried @vanadium 's suggestion and I couldn't really find out much. I just saw cached memory increase drastically. Then some time later I remembered that I had installed `preload`, which, if I remember correctly is a daemon which determines the most used applications and then preloads them in RAM. I don't think I had preload configured properly. As a result, it appears to have cached too much. I decided to uninstall preload, and after a reboot, the issue seems to have been solved.
alfx avatar
pl flag
thanks for this @Devvrath. if that worked, could you explain the how to of your solution replying to you own question please?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.