4

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
  • 301

1 Answers1

0

Copying @Devvrath's comment into an answer, since it is 3 years old now and has not been converted yet.

@Devvrath had installed the preload package, after uninstalling the package their issue disappeared.

preload is a daemon that monitors/analyzes the applications users run, and tries to keep data in cache to improve the startup time of these applications.

From documentation of preload (emphasis mine):

The default values for the memory usage formula result in:

max (0,−10% × model.memtotal + 100% × model.memfree) + 30% × model.memcached

which essentially means: use all free memory except for ten percent of total memory, and thirty percent of memory already used for caches. When a system is in steady state, there is little free memory available since the kernel utilizes most of the free memory for caching. During boot time on the other hand, there is little cached memory and a lot of free memory. Given this, the model.memfree and model.memcached controls enable tuning preload’s aggressiveness during boot process and steady state fairly separately.

As indicated by this answer, a potential drawback of preload is that the RAM it consumes takes away from the pool of "unused" RAM that the kernel could otherwise use for its own caching purposes. Depending on your particular situation/usage patterns (and the tuning of preload's configuration parameters), preload might help or harm performance.

effect
  • 101