Excessive RAM usage

At boot I have had issues with high RAM usage despite nothing being listed above 1Gb in the system monitor. After closing everything, I have about 20-25 Gb being used. I am running the LQX kernel, though this issue occurs on the Zen kernel too.

What does htop show in terms of applications being open and using memory?

This is while playing a game too. currently I am using 20Gb of RAM. What gotop is showing suggests it should be much lower.

KDE system monitor also shows the same info, both in the applications and processes tab.

I remember being a PSA website being spread around when I first began using Linux that stated that Linux uses RAM more heavily than Windows for caching. Perhaps this is what is happening here? I’m not sure, to be honest.

1 Like

I’ve heard that there might be a program that uses RAM for /tmp but I’m not sure how to verify that. It’s getting quite annoying getting system lockups while gaming.

Show us this commands

cat /etc/fstab
free -h --giga

Looking into it more it appears that my issue might be tmpfs, but my tmp directory is only a couple dozen Mb large. I don’t know how to check what is using up all my RAM either.

File: /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=97FE-ADA3                              /efi                     vfat    fmask=0137,dmask=0027
 0 2
UUID=de2080c2-48b0-4ec8-be13-ee2f1f904c22   /                        ext4    noatime
 0 1
UUID=ac2c7955-976f-4794-b3e6-1d740c168498   /home/lucian/Data/HDD1   ext4    defaults,exec,users
 0 0
               total        used        free      shared  buff/cache   available
Mem:             33G         17G        7.1G        357M        9.7G         15G
Swap:             0B          0B          0B

I’m sorry I have no idea how to format forum posts.

It doesn’t look like you are using ram for tmp.

Try analyzing the situation with this command

ps -eo size,pid,user,command --sort -size | \
    awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |\
    cut -d "" -f2 | cut -d "-" -f1
       0.00 Mb COMMAND 
       772.17 Mb /usr/lib/electron29/electron 
       402.87 Mb /opt/vivaldi/vivaldi
       438.79 Mb /opt/vivaldi/vivaldi
       342.23 Mb /opt/vivaldi/vivaldi
       209.85 Mb /opt/vivaldi/vivaldi
       574.67 Mb /usr/lib/electron29/electron /usr/lib/vesktop/app.asar env ELECTRON_OZONE_PLATFORM_HINT=auto 
       377.75 Mb /opt/vivaldi/vivaldi
       298.52 Mb /opt/vivaldi/vivaldi
       251.14 Mb /opt/vivaldi/vivaldi
       273.21 Mb /opt/vivaldi/vivaldi
       302.49 Mb /opt/vivaldi/vivaldi
       309.87 Mb /opt/vivaldi/vivaldi
       247.76 Mb /opt/vivaldi/vivaldi
       247.55 Mb /opt/vivaldi/vivaldi
       248.67 Mb /opt/vivaldi/vivaldi
       229.25 Mb /opt/vivaldi/vivaldi
       208.33 Mb /opt/vivaldi/vivaldi
       206.05 Mb /opt/vivaldi/vivaldi
       131.31 Mb /opt/vivaldi/vivaldi
       121.29 Mb /usr/lib/baloorunner 
       435.82 Mb /usr/lib/kf6/baloo_file_extractor 
        80.91 Mb /usr/lib/kf6/baloo_file 
       717.07 Mb /home/lucian/.local/share/Steam/ubuntu12_64/steamwebhelper 
       187.67 Mb /home/lucian/.local/share/Steam/ubuntu12_64/steamwebhelper 
       643.80 Mb /opt/vivaldi/vivaldi
       424.82 Mb /opt/vivaldi/vivaldi
       330.69 Mb /usr/lib/electron29/electron 
        91.03 Mb /usr/lib/electron29/electron 
        82.31 Mb /opt/vivaldi/vivaldi
       174.70 Mb /opt/vivaldi/vivaldi
       136.79 Mb /opt/vivaldi/vivaldi
       139.94 Mb /usr/lib/electron29/electron 
        59.98 Mb /opt/vivaldi/vivaldi
        59.91 Mb /opt/vivaldi/vivaldi
        59.96 Mb /opt/vivaldi/vivaldi
         8.86 Mb /usr/lib/electron29/electron 
         8.77 Mb /usr/lib/electron29/electron 
         8.79 Mb /usr/lib/electron29/electron 
        21.90 Mb /opt/vivaldi/chrome_crashpad_handler 
        13.39 Mb /opt/vivaldi/chrome_crashpad_handler 
       873.74 Mb ./steamwebhelper 
      1237.66 Mb /usr/bin/plasmashell 
       462.09 Mb /usr/bin/krunner 
       451.23 Mb /usr/bin/kwin_wayland 
       425.73 Mb /home/lucian/.local/share/Steam/ubuntu12_64/steamwebhelper 
       395.15 Mb /usr/bin/corectrl 
       209.52 Mb /usr/bin/ktorrent 
       163.32 Mb /usr/bin/kded6 
       125.51 Mb /usr/lib/xdg
       126.18 Mb /usr/bin/plasma
       145.81 Mb /usr/bin/alacritty 
       147.87 Mb /usr/bin/alacritty 
       143.50 Mb /usr/bin/alacritty 
       119.45 Mb /usr/bin/kwalletd6 
       120.38 Mb /usr/lib/kdeconnectd 
       119.48 Mb /usr/lib/polkit
       119.49 Mb /usr/lib/DiscoverNotifier 
       118.30 Mb /usr/lib/org_kde_powerdevil 
       118.84 Mb /usr/lib/kactivitymanagerd 
        78.88 Mb /home/lucian/.local/share/Steam/ubuntu12_64/steamwebhelper 
       156.89 Mb /usr/bin/Xwayland :1 
       101.05 Mb /usr/bin/kaccess 
        99.67 Mb /usr/bin/ksmserver 
       109.67 Mb /usr/lib/Xorg 
       126.34 Mb /home/lucian/.local/share/Steam/ubuntu12_64/steamwebhelper 
       250.33 Mb /home/lucian/.local/share/Steam/ubuntu12_32/steam 
       223.67 Mb /usr/bin/wireplumber 
        56.95 Mb gotop 
        99.86 Mb /home/lucian/.local/share/Steam/ubuntu12_64/steamwebhelper 
        84.47 Mb /usr/bin/python /usr/bin/firewall
        59.53 Mb /usr/bin/NetworkManager 
        66.68 Mb /usr/lib/xdg
        72.10 Mb /usr/lib/pentablet/PenTablet /mini 
        59.51 Mb /usr/lib/xdg
        51.59 Mb /usr/lib/udisks2/udisksd 
        47.28 Mb /usr/bin/zerotier
        42.05 Mb /usr/lib/corectrl/corectrl_helper 
        21.24 Mb /home/lucian/.local/share/Steam/ubuntu12_64/steamwebhelper 
        43.75 Mb /usr/lib/polkit
        41.39 Mb /usr/lib/at
        56.45 Mb /home/lucian/.local/share/Steam/ubuntu12_64/steamwebhelper 
        56.45 Mb /home/lucian/.local/share/Steam/ubuntu12_64/steamwebhelper 
        29.78 Mb /usr/bin/ksystemstats 
        35.09 Mb /usr/lib/upowerd 
        33.39 Mb /usr/lib/power
        32.97 Mb /usr/lib/geoclue
        32.91 Mb /usr/lib/xdg
        25.00 Mb steam
        34.86 Mb /usr/bin/fish 
        26.85 Mb /usr/bin/fish 
        25.05 Mb /usr/lib/dconf
        17.84 Mb /usr/bin/gmenudbusmenuproxy 
        17.83 Mb /usr/bin/xembedsniproxy 
        10.71 Mb /usr/bin/startplasma
        18.39 Mb /usr/bin/fish 
        74.07 Mb /usr/bin/pipewire
         9.61 Mb /usr/bin/sddm 
         9.19 Mb /usr/bin/kwin_wayland_wrapper 
        42.19 Mb /usr/bin/pipewire 
        32.11 Mb /usr/bin/python /usr/bin/firewalld 
         8.71 Mb /usr/lib/systemd/systemd
        25.63 Mb /usr/lib/systemd/systemd
         1.68 Mb /usr/lib/sddm/sddm
         0.62 Mb /usr/lib/bluetooth/obexd 
         2.51 Mb /usr/lib/systemd/systemd
         0.55 Mb /usr/lib/pressure
         0.97 Mb (sd
        16.40 Mb /usr/lib/rtkit
         3.43 Mb /usr/lib/systemd/systemd 
         1.88 Mb /usr/lib/systemd/systemd 
         1.11 Mb /usr/bin/wpa_supplicant 
         0.94 Mb /usr/lib/systemd/systemd
         5.49 Mb cat 
         5.49 Mb cat 
         0.75 Mb /usr/lib/systemd/systemd
         0.72 Mb /usr/bin/dnsmasq 
         0.72 Mb /usr/bin/dnsmasq 
         0.70 Mb /usr/lib/bluetooth/bluetoothd 
         1.93 Mb ps 
         0.77 Mb sshd: /usr/bin/sshd 
         0.57 Mb awk { hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" } 
         0.96 Mb /usr/bin/dbus
         0.45 Mb /usr/bin/dbus
         0.60 Mb avahi
         0.60 Mb avahi
         0.53 Mb /usr/bin/xsettingsd 
         0.79 Mb bash /home/lucian/.local/share/Steam/steam.sh 
         0.53 Mb /bin/sh /usr/lib/pentablet/PenTablet.sh /mini 
         2.86 Mb dbus
         2.34 Mb dbus
         0.33 Mb cut 
         0.33 Mb cut 
         0.34 Mb /home/lucian/.local/share/Steam/ubuntu12_64/steam
         0.33 Mb fusermount3 
         0.00 Mb [kthreadd] 
         0.00 Mb [pool_workqueue_release] 
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/0:0H
         0.00 Mb [kworker/R
         0.00 Mb [rcu_tasks_kthread] 
         0.00 Mb [rcu_tasks_rude_kthread] 
         0.00 Mb [rcu_tasks_trace_kthread] 
         0.00 Mb [ksoftirqd/0] 
         0.00 Mb [rcu_preempt] 
         0.00 Mb [rcub/1] 
         0.00 Mb [rcu_exp_gp_kthread_worker] 
         0.00 Mb [rcu_exp_par_gp_kthread_worker] 
         0.00 Mb [migration/0] 
         0.00 Mb [idle_inject/0] 
         0.00 Mb [cpuhp/0] 
         0.00 Mb [cpuhp/1] 
         0.00 Mb [idle_inject/1] 
         0.00 Mb [migration/1] 
         0.00 Mb [ksoftirqd/1] 
         0.00 Mb [kworker/1:0H
         0.00 Mb [cpuhp/2] 
         0.00 Mb [idle_inject/2] 
         0.00 Mb [migration/2] 
         0.00 Mb [ksoftirqd/2] 
         0.00 Mb [kworker/2:0H
         0.00 Mb [cpuhp/3] 
         0.00 Mb [idle_inject/3] 
         0.00 Mb [migration/3] 
         0.00 Mb [ksoftirqd/3] 
         0.00 Mb [kworker/3:0H
         0.00 Mb [cpuhp/4] 
         0.00 Mb [idle_inject/4] 
         0.00 Mb [migration/4] 
         0.00 Mb [ksoftirqd/4] 
         0.00 Mb [kworker/4:0H
         0.00 Mb [cpuhp/5] 
         0.00 Mb [idle_inject/5] 
         0.00 Mb [migration/5] 
         0.00 Mb [ksoftirqd/5] 
         0.00 Mb [kworker/5:0H
         0.00 Mb [cpuhp/6] 
         0.00 Mb [idle_inject/6] 
         0.00 Mb [migration/6] 
         0.00 Mb [ksoftirqd/6] 
         0.00 Mb [kworker/6:0H
         0.00 Mb [cpuhp/7] 
         0.00 Mb [idle_inject/7] 
         0.00 Mb [migration/7] 
         0.00 Mb [ksoftirqd/7] 
         0.00 Mb [kworker/7:0H
         0.00 Mb [cpuhp/8] 
         0.00 Mb [idle_inject/8] 
         0.00 Mb [migration/8] 
         0.00 Mb [ksoftirqd/8] 
         0.00 Mb [kworker/8:0H
         0.00 Mb [cpuhp/9] 
         0.00 Mb [idle_inject/9] 
         0.00 Mb [migration/9] 
         0.00 Mb [ksoftirqd/9] 
         0.00 Mb [kworker/9:0H
         0.00 Mb [cpuhp/10] 
         0.00 Mb [idle_inject/10] 
         0.00 Mb [migration/10] 
         0.00 Mb [ksoftirqd/10] 
         0.00 Mb [kworker/10:0H
         0.00 Mb [cpuhp/11] 
         0.00 Mb [idle_inject/11] 
         0.00 Mb [migration/11] 
         0.00 Mb [ksoftirqd/11] 
         0.00 Mb [kworker/11:0H
         0.00 Mb [kdevtmpfs] 
         0.00 Mb [kworker/R
         0.00 Mb [oom_reaper] 
         0.00 Mb [kworker/R
         0.00 Mb [kcompactd0] 
         0.00 Mb [ksmd] 
         0.00 Mb [khugepaged] 
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [irq/9
         0.00 Mb [kworker/10:1
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [watchdogd] 
         0.00 Mb [kworker/2:1H
         0.00 Mb [irq/25
         0.00 Mb [kswapd0] 
         0.00 Mb [kworker/R
         0.00 Mb [irq/27
         0.00 Mb [irq/28
         0.00 Mb [irq/29
         0.00 Mb [irq/31
         0.00 Mb [irq/32
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [scsi_eh_0] 
         0.00 Mb [kworker/R
         0.00 Mb [scsi_eh_1] 
         0.00 Mb [kworker/R
         0.00 Mb [scsi_eh_2] 
         0.00 Mb [kworker/R
         0.00 Mb [scsi_eh_3] 
         0.00 Mb [kworker/R
         0.00 Mb [scsi_eh_4] 
         0.00 Mb [kworker/R
         0.00 Mb [scsi_eh_5] 
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/1:1H
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/u67:0
         0.00 Mb [kworker/R
         0.00 Mb [irq/26
         0.00 Mb [kworker/3:1H
         0.00 Mb [kworker/0:1H
         0.00 Mb [kworker/4:1H
         0.00 Mb [kworker/5:1H
         0.00 Mb [kworker/9:1H
         0.00 Mb [kworker/6:1H
         0.00 Mb [kworker/11:1H
         0.00 Mb [kworker/8:1H
         0.00 Mb [kworker/7:1H
         0.00 Mb [kworker/10:1H
         0.00 Mb [kworker/R
         0.00 Mb [jbd2/nvme0n1p2
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [irq/96
         0.00 Mb [irq/97
         0.00 Mb [irq/98
         0.00 Mb [irq/99
         0.00 Mb [irq/100
         0.00 Mb [irq/101
         0.00 Mb [irq/102
         0.00 Mb [irq/103
         0.00 Mb [irq/104
         0.00 Mb [irq/105
         0.00 Mb [irq/106
         0.00 Mb [irq/107
         0.00 Mb [irq/108
         0.00 Mb [irq/109
         0.00 Mb [jbd2/sda1
         0.00 Mb [kworker/R
         0.00 Mb [kworker/u67:1
         0.00 Mb [kworker/R
         0.00 Mb [scsi_eh_6] 
         0.00 Mb [kworker/R
         0.00 Mb [usb
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [kworker/R
         0.00 Mb [card0
         0.00 Mb [card0
         0.00 Mb [card0
         0.00 Mb [card0
         0.00 Mb [card0
         0.00 Mb [card0
         0.00 Mb [krfcommd] 
         0.00 Mb [kworker/6:2
         0.00 Mb [kworker/7:1
         0.00 Mb [kworker/8:2
         0.00 Mb [kworker/3:0
         0.00 Mb [kworker/4:1
         0.00 Mb [kworker/u65:3
         0.00 Mb [kworker/0:2
         0.00 Mb [kworker/5:1
         0.00 Mb [kworker/3:1] 
         0.00 Mb [kworker/8:0] 
         0.00 Mb [kworker/u69:2
         0.00 Mb [kworker/6:0
         0.00 Mb [kworker/10:0
         0.00 Mb [kworker/9:1
         0.00 Mb [kworker/u64:3
         0.00 Mb [kworker/1:2
         0.00 Mb [kworker/u66:3
         0.00 Mb [kworker/u65:0
         0.00 Mb [kworker/11:0
         0.00 Mb [kworker/u66:0
         0.00 Mb [kworker/u68:15
         0.00 Mb [kworker/0:1] 
         0.00 Mb [kworker/9:0] 
         0.00 Mb [kworker/2:0
         0.00 Mb [kworker/7:0
         0.00 Mb [kworker/11:2
         0.00 Mb [kworker/u69:10
         0.00 Mb [kworker/5:0
         0.00 Mb [kworker/u64:1
         0.00 Mb [kworker/4:0] 
         0.00 Mb [kworker/u66:4
         0.00 Mb [kworker/u68:2
         0.00 Mb [kworker/2:1
         0.00 Mb [kworker/1:1
         0.00 Mb [kworker/u64:0
         0.00 Mb [kworker/u65:4
         0.00 Mb [kworker/u69:0] 
         0.00 Mb [kworker/4:2] 
         0.00 Mb [kworker/2:2
         0.00 Mb [kworker/u64:2
         0.00 Mb [kworker/1:0
         0.00 Mb [kworker/u65:1
         0.00 Mb [kworker/u68:0
         0.00 Mb [kworker/u68:1
         0.00 Mb [kworker/u68:3] 

Is the situation the same even after a reboot, without any applications started?

It has normal RAM usage at boot. However my CPU usage stays quite high for a while. So far my memory usage is still looking normal, perhaps it builds up after long term use? I sometimes leave my PC on overnight to update files.

EDIT: Logging out and back in does not reset my RAM usage like like a full reboot does.

I did some quick calculations, only Electron and Vivaldi take up more than 8 gigabytes of RAM…I don’t think it’s normal

1 Like

It seems to be slowly increasing, what’s odd is the mystery RAM usage seems to cap at 50% of my max.

Electron apps are usually RAM and CPU hungry, and well a browser, any browser…how may tabs does the OP have open? or pinned?

I have about 70 tabs open, though only about 20 loaded. This should not persist after I have closed my browser and gotop should indicate that the browser is using large amounts of RAM if it is the case.

Perhaps this one?

https://www.linuxatemyram.com/

In Linux, if there is available RAM your system will try to use as much as it can (on purpose) for disk caching. If an application or process needs memory that is being used for caching it is immediately released to the application, otherwise it just hangs out in case you can use it again later.

This improves the performance of your machine and has basically no downside, except the fact that it can be confusing for folks who don’t know what they are looking at.

2 Likes

I am having issues with system lockups when I play games though. This results in my having to manage my ram as if I only have 16 gigs. I might have to close this issue since I’m having issues with hard shutdowns, I think my CPU is about to die.

It looks like you have tons of available memory, so I don’t think exhausting the RAM is causing your issue.

It is possible your issue is caused by not having a swap device set up. Swap is not only for situations when your system has run out of memory, it is also needed for allowing memory to be used efficiently. Also many applications map memory directly to swap (games especially seem to be guilty of this). See this comment for example: Swap or not? - #33 by cjbottaro

For setups like this where you have an abundance of RAM, setting up a zram swap device is an attractive option because it is way faster than normal swap and does not cost any writes to the disk because it creates a compressed block device for swap right in RAM. https://wiki.archlinux.org/title/Zram

It is super easy to set up if you use the zram-generator package. Just install the package:

sudo pacman -S zram-generator

Then create a config for it in /etc/systemd/zram-generator.conf.

[zram0]
zram-size=ram
compression-algorithm = zstd

That’s all there is to it! After a reboot, you use inxi to confirm the swap device has been automatically set up.

inxi -j
4 Likes

Why?