1

All my apps (except terminator that runs htop) are closed.

OS is taking more than 6GB of memory. Crazy how high this is!!!

See screencap showing sudo htop.

Before the screencap, I've killed a bunch of other apps:

sudo pkill -f gnome-calendar
sudo pkill -f evolution-alarm-notify
sudo pkill -f evolution-calendar-factory
sudo systemctl stop snapd

Also restarted gnome-shell to reset it's memory:

alt+f2 + r + enter
or
killall -SIGHUP gnome-shell

* Had this problem with 19.10 as well.

enter image description here

1 Answers1

0

Some memory may be used to cache some disk space - it'll be freed automatically if needed by programs

do a

free -m

to see real free memory : "available" column

How do I stop Linux from doing this?

You can't disable disk caching. The only reason anyone ever wants to disable disk caching is because they think it takes memory away from their applications, which it doesn't! Disk cache makes applications load faster and run smoother, but it NEVER EVER takes memory away from them! Therefore, there's absolutely no reason to disable it!

If, however, you find yourself needing to clear some RAM quickly to workaround another issue, like a VM misbehaving, you can force linux to nondestructively drop caches using echo 3 | sudo tee /proc/sys/vm/drop_caches.

see more here : https://www.linuxatemyram.com/

Koen
  • 1,167
  • 1
    When I start some heavy apps, like Intellij IDEA and many chrome tabs, the memory of the OS stays very high. Memory isn't being "freed" for the apps I started. – AlikElzin-kilaka Dec 31 '20 at 14:15