3

I'm having a RAM problem where my RAM is full but there's nothing consuming al of it. The sudo htop commands shows my real memory usage, while sudo gnome-system-monitor shows the memory full. It wouldn't be a problem but the system actually thinks it's full so it closes firefox tabs, and I can't open other VMs.

It's worth noting that I use VMs but they are stopped. Maybe when I stop there's a bug in KVM which does not free the VM memory. Right now I have a VM with 15gb of RAM + firefox on the host machine with lots of tabs, it should be taking 19gb as said by htop.

Ubuntu 22.04. This wasn't happening in 21.10 and 21.04

enter image description here

PS: the problem seems to happen when I open an Android Studio emulator and then close it. THe memory never goes away, even though there are no more processes for qemu, even on root. Maybe this has to do with the ballooning driver?

12
  • 1
    The total size of your RAM 33.4 GB and the relatively high system load makes me think you have the kernel module zram enabled. Is it enabled? … as this might explain what is going on with your RAM.
    – Raffa
    Jun 6 at 6:19
  • 1
    Also, do you have any configured tmpfs or RAM disk/s ?
    – Raffa
    Jun 6 at 6:33
  • @Raffa lsmod | grep ram is empty
    – Rafaelo
    Jun 6 at 10:58
  • @Raffa take a look at my update
    – Rafaelo
    Jun 6 at 10:59
  • 1
    It should in ideal situations but, things like this (a different virtualization solution) may happen on both sides guest/host probably due to user configuration or unsupported driver … What I suggest here, however, is just an educated guess based on your observation and feedback … but, only you can troubleshoot, isolate and confirm the cause as you have already done 50% of that by isolating the android VM … now concentrate your troubleshooting on that to find precisely what element is to blame/exclude :)
    – Raffa
    Jun 7 at 4:16

1 Answer 1

6

You are not comparing the same things. Your graphical display is showing cached memory, which always tends to eventually appear full with linux, and your numeric display is showing what memory is actually available if recoverable caches were dropped which they will be if the memory is needed. Example, notice how the cache size changes after I ask the system to delete them:

root@s15:/home/doug# free -m
               total        used        free      shared  buff/cache   available
Mem:           15724         407         152           5       15163       14983
Swap:          16085         132       15953
root@s15:/home/doug# sync
root@s15:/home/doug# echo 3 > /proc/sys/vm/drop_caches
root@s15:/home/doug# free -m
               total        used        free      shared  buff/cache   available
Mem:           15724         407       15139           5         176       15062
Swap:          16085         132       15953
3
  • 2
    but I'm getting tab closes on firefox, and I can't open 2 vms with 12gb each. This never happened before and the memory always followed what I had open. How can I stop the firefox tabs from closing?
    – Rafaelo
    May 21 at 15:18
  • Output of journalctl -xe after a crash would be helpful to see if any OOM (out of memory) errors are occurring. You can do sudo journalctl -xe > output.txt to create a file output.txt containing the logs, then upload to Pastebin and edit your question to provide a link to that.
    – Jivan Pal
    Jun 9 at 9:36
  • @Rafaelo Do you mean Firefox tabs closing without you doing nothing? Maybe is related to this feature/bug Jun 10 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.