0

I have a 12GB RAM system, and I find that usually it has a lot of memory consumption without any program other than nautilus or gedit opened.

If I do an htop and see which processes are running (ordering by MEM%), I see that gnome-shell has the top memory consumption with a 2.2%, nautilus with a 1.2% and the rest has less than 1% consumption. In no means I see how that list of running processes sums the quantity of used memory

htop capture

  • It is possible that any process has used some memory but it didn't freed it correctly?
  • How can I free that all memory that seems to be in no use for anyone?

This is a bit annoying because I usually find that some program suddenly closes or the system freezes because of high memory usage.

Has anyone had a similar problem?

Edit: Add output of free

➜  ~ free -mh
              total       usado       libre  compartido búfer/caché  disponible
Memoria:        11Gi       4,7Gi       3,5Gi       733Mi       3,3Gi       5,8Gi
Swap:         7,8Gi       6,0Gi       1,8Gi
  • 2
    I'm curious to know why your swap usage is so high when so little RAM is shown as being in use. Have you modified your vm.swappiness configuration? – matigo Apr 11 '22 at 07:30
  • Please add output of free -mh. The usual answer is "Unused Memory is wasted Memory". And the numbers seem fine. But yes, the swap usage seems the problem here rather. – pLumo Apr 11 '22 at 07:34
  • @matigo I don't remember. I've made a lot of changes. Right now I have: cat /proc/sys/vm/swappiness -> 60 – fernandezr Apr 11 '22 at 07:55
  • 1
    A value of 60 is default, and generally good for most desktop systems with 16GB or less. Artur's answer may give you an indication of what to look for – matigo Apr 11 '22 at 08:15
  • Same problem here, only happened on 22.04, on 21.10 and before it worked fine. With time it accumulates RAM. – Rafaelo Jun 19 '22 at 02:28

1 Answers1

2

It seems Microsoft VSCode (/usr/share/code/code) has an extremely large "Virtual Memory Map", as well as multiple spawned processes. This does not equal actual real or virtual memory use, but it could pose a problem.

There are other reports that MS VSCode can use high amounts of CPU or memory - this could probably be caused by third party extensions.

So the first thing I would try is to disable MS VSCode altogether and see if that helps. If you can locate the source of the problem, then you can also try to fix it from there.

And to try and answer your title question: I doubt the core Ubuntu system has memory leaks, but it's more likely that an application like VSCode, including some third party extensions, has a memory leak that's affecting you.

Artur Meinild
  • 31,385