What is going on with my memory utilization

I can’t figure out what is going on with my memory utilization. I am constantly running out of RAM and having problems with applications. It doesn’t seem to be buffer related as in linuxatemyram.com.

I just closed some applications to free up some RAM and here is a snapshot of what I am seeing:

---------------------------------
                         13.1 GiB
=================================
>> free -m
               total        used        free      shared  buff/cache   available
Mem:           64217       46005       17089         129        1122       17374
Swap:          16383        6613        9770

The top section is the output from ps_mem, applications are using 13.1 GiB. But I have over 52 GiB in use and only about 1 GiB of that is shared memory/buffers/cache.

Hello Dalto, here are my ps_mem and free -m so you can compare with, unfortunately I don’t know how to help you, maybe this info can help you.

free -m
               total        used        free      shared  buff/cache   available
Mem.:          32078        4569       24703         240        2804       26874
Swap:            511           0         511
$ uptime 
 13:41:26 up  1:54,  1 user,  load average: 0,23, 0,38, 0,36
ps_mem
 Private  +   Shared  =  RAM used	Program

148.0 KiB +  18.5 KiB = 166.5 KiB	fusermount3
412.0 KiB +  47.5 KiB = 459.5 KiB	rtkit-daemon
488.0 KiB +  66.5 KiB = 554.5 KiB	gnome-session-ctl
668.0 KiB +  69.5 KiB = 737.5 KiB	dconf-service
740.0 KiB +  79.5 KiB = 819.5 KiB	gdm-wayland-session
860.0 KiB +  81.5 KiB = 941.5 KiB	gsd-screensaver-proxy
908.0 KiB +  99.5 KiB =   1.0 MiB	gsd-a11y-settings
  1.0 MiB + 100.5 KiB =   1.1 MiB	at-spi2-registryd
  1.1 MiB + 103.5 KiB =   1.2 MiB	at-spi-bus-launcher
  1.1 MiB + 113.5 KiB =   1.2 MiB	gsd-usb-protection
  1.3 MiB +  94.5 KiB =   1.3 MiB	gvfsd-metadata
  1.2 MiB + 171.5 KiB =   1.4 MiB	gvfs-gphoto2-volume-monitor
904.0 KiB + 552.5 KiB =   1.4 MiB	systemd-timesyncd
  1.4 MiB + 227.5 KiB =   1.6 MiB	gsd-sound
  1.4 MiB + 267.5 KiB =   1.7 MiB	gsd-disk-utility-notify
  1.7 MiB + 225.5 KiB =   1.9 MiB	gdm
  1.5 MiB + 558.5 KiB =   2.0 MiB	gsd-sharing
  1.5 MiB + 694.5 KiB =   2.1 MiB	systemd-logind
  1.7 MiB + 489.5 KiB =   2.1 MiB	gvfsd-trash
  2.2 MiB +  89.5 KiB =   2.3 MiB	wpa_supplicant
  2.4 MiB + 146.5 KiB =   2.6 MiB	accounts-daemon
  2.2 MiB + 594.5 KiB =   2.8 MiB	sudo
  2.8 MiB +  89.5 KiB =   2.8 MiB	bash
  2.8 MiB +  78.5 KiB =   2.8 MiB	xdg-permission-store
  2.9 MiB +  89.5 KiB =   3.0 MiB	gvfs-mtp-volume-monitor
  2.7 MiB + 322.5 KiB =   3.0 MiB	gsd-printer
  3.0 MiB + 106.5 KiB =   3.1 MiB	power-profiles-daemon
  3.0 MiB +  95.5 KiB =   3.1 MiB	gsd-rfkill
  3.1 MiB + 175.5 KiB =   3.2 MiB	gvfsd-fuse
  2.8 MiB + 572.5 KiB =   3.4 MiB	gvfs-udisks2-volume-monitor
  3.1 MiB + 291.5 KiB =   3.4 MiB	gnome-keyring-daemon
  3.4 MiB + 155.5 KiB =   3.6 MiB	gsd-housekeeping
  3.3 MiB + 335.5 KiB =   3.6 MiB	gsd-smartcard
  3.1 MiB + 614.5 KiB =   3.7 MiB	xdg-desktop-portal
  3.0 MiB + 747.5 KiB =   3.8 MiB	gdm-session-worker
  3.6 MiB + 190.5 KiB =   3.8 MiB	gsd-print-notifications
  3.4 MiB + 443.5 KiB =   3.8 MiB	gvfsd
  3.5 MiB + 574.5 KiB =   4.1 MiB	systemd-udevd
  3.6 MiB + 542.5 KiB =   4.2 MiB	gsd-datetime
  3.6 MiB + 731.5 KiB =   4.3 MiB	gvfs-afc-volume-monitor
  3.6 MiB + 688.5 KiB =   4.3 MiB	systemd-journald
  4.4 MiB + 507.5 KiB =   4.9 MiB	dbus-daemon (3)
  5.2 MiB + 112.5 KiB =   5.3 MiB	upowerd
  5.2 MiB + 182.5 KiB =   5.3 MiB	xdg-document-portal
  5.2 MiB + 473.5 KiB =   5.7 MiB	udisksd
  6.1 MiB +   1.1 MiB =   7.2 MiB	gnome-session-binary (2)
  7.2 MiB +   1.0 MiB =   8.2 MiB	gsd-media-keys
  7.8 MiB + 729.5 KiB =   8.5 MiB	xdg-desktop-portal-gtk
  7.9 MiB + 742.5 KiB =   8.6 MiB	colord
  7.4 MiB +   1.3 MiB =   8.7 MiB	gsd-color
  8.4 MiB + 798.5 KiB =   9.2 MiB	gsd-keyboard
  8.7 MiB + 818.5 KiB =   9.5 MiB	gsd-wacom
  9.1 MiB + 790.5 KiB =   9.9 MiB	NetworkManager
  9.0 MiB + 903.5 KiB =   9.9 MiB	gsd-power
  8.7 MiB +   1.2 MiB =  10.0 MiB	pipewire
  5.3 MiB +   5.1 MiB =  10.4 MiB	systemd (3)
 13.5 MiB +   2.7 MiB =  16.2 MiB	pipewire-media-session
 17.3 MiB + 182.5 KiB =  17.4 MiB	polkitd
 13.2 MiB +   4.5 MiB =  17.7 MiB	gnome-terminal-server
 15.3 MiB +   8.3 MiB =  23.6 MiB	gjs-console (2)
 25.1 MiB +   1.3 MiB =  26.4 MiB	xdg-desktop-portal-gnome
 20.5 MiB +   8.4 MiB =  28.9 MiB	gsd-xsettings
 29.9 MiB + 824.5 KiB =  30.7 MiB	pipewire-pulse
 53.8 MiB +   5.9 MiB =  59.6 MiB	gedit
 58.7 MiB +   1.6 MiB =  60.3 MiB	tracker-miner-fs-3
 53.8 MiB +  22.5 MiB =  76.3 MiB	Xwayland
142.0 MiB +  33.2 MiB = 175.3 MiB	gnome-shell
323.9 MiB +  69.1 MiB = 393.0 MiB	thunderbird (2)
435.3 MiB + 119.2 MiB = 554.5 MiB	signal-desktop (8)
  2.6 GiB + 230.1 MiB =   2.9 GiB	firefox (26)
---------------------------------
                          4.5 GiB
=================================
1 Like

I like this tool for memory. Mine is showing 3.5 GB on KDE Plasma.

1 Like

Yours is normal. You memory in use and your ps_mem output is more or less the same. I have a ~40GiB difference. :thinking:

1 Like

What does it look like after a clean boot? Maybe try running one app at a time to see if it becomes obvious who the culprit is.

1 Like

I can only take a guess maybe some VM left running somewhere? :sweat_smile:
They have some funky way of managing RAM (meaning it doesn’t always show as normal process)

1 Like

It looks fine immediately after boot and slowly builds up over time. It doesn’t jump up suddenly when opening a single application.

I closed all my VMs before taking those stats above.

1 Like

OK, I figured it out. It is the ZFS ARC cache. It defaults to 50% of available memory which appears to include swap. While it automatically scales down when applications demand memory, that doesn’t help when applications take action based on available memory.

I lowered the cache to a more reasonable number for my use case(5GiB) and the impact was instant.

---------------------------------
                         17.3 GiB
=================================
>> free -m
               total        used        free      shared  buff/cache   available
Mem:           64217       17398       45109         547        1708       45589
Swap:          16383        6759        9624

I am a bit curious to see if there is any notable decrease in performance since I no longer have ~40GiB of data in cache.

5 Likes

Is it intended?
ARC seems to be just storage of read cache in RAM, so if it includes swap it’s practically same as zswap / zram?

Hmm…I think it is different. zram is compressing swap into RAM. Essentially giving you more available RAM at the expense of the CPU cost of having to decompress it on the fly.

ARC, if I understand it, is caching data from the disk in memory. Making disk reads faster at the expense of RAM utilization.

3 Likes

Zswap is a Linux kernel feature providing a compressed write-back cache for swapped pages. This increases the performance and decreases the IO-Operations. ZRAM creates a virtual compressed Swap-file in memory as alternative to a swapfile on disk.

(c) archwiki

honka_animated-128px-49

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.