Huge RAM leak on restart

Hi, so i got this huge ram leak on manjaro and dont know what to do about,
htop doesn’t listed any proccess that could be using this amount on ram
i have been calculated that is about 4.5 GB

i have removed discord and wine since some pages listed this apps as possibles causes but nothing, i even have upgraded the kernel form 5.9 to 5.11 but the problem stay the same.

pd: sorry for the bad english

Hi and welcome to the forum :wave:

For people here to help you better more data is needed. Check this post on how to provide it.

Readers probably want to know:
Since it is beneficial to have used code in RAM what do you see on your system that is a RAM leak in your case?
How did you determine that this is a leak and can you share some more info?

Removing applications such as wine or discord will not lower RAM use when not started.

For example the output of
free --human --total
would give a picture of your RAM in use on your system.

 ~]$ free --human --total
               total        used        free      shared  buff/cache   available
Mem:            15Gi       9,6Gi       572Mi       233Mi       5,3Gi       5,4Gi
Swap:           29Gi       1,0Mi        29Gi
Total:          45Gi       9,6Gi        30Gi

thanks for the help, as can be seen here, there is 15 gb aprox installed on the system, 5.3 gb used and 5.4 available, so where is the missing 4 gb? thats is a ram leak?
maybe it shouldn’t be called a leak because the 4 gb missing are permanent.

Thanks for the output, this seems like a normal system. Memory info is not so straight forward. I’m not good at explaining but there is a app site for that: https://www.linuxatemyram.com/ . I hope this explains it for you.

Thanks for the info

free --human --total
               total        used        free      shared  buff/cache   available
Mem:            15Gi       4,7Gi        10Gi        80Mi       684Mi        10Gi
Swap:           29Gi          0B        29Gi
Total:          45Gi       4,7Gi        40Gi

so this is a capture on a fresh restart, there are 4.7gb used, what i had understood is that this 4 gb should be listed as buff/cache, so the given page doesn’t explain why there are 4 gb used in a fresh restart since this is not “buff/cache”. i have been thinking that maybe this memory is reserved for the integrated gpu the intel hd 630 uhd, but i cannot say for sure.

You need to remember that /tmp is mounted on tmpfs which is ram based - so nothing is missing.

Also for your amusement read the linux-ate-my-ram link

i don’t get it, can you give me more info about the relation betwen tmp, tmpfs and the ram? i have been reading about but it is supposed that this files should be cleaned after a restart, but there arent.

But in linuxatemyram.com-play.html i manage to run the test and it run until 10814 MB, so the there are 4 gb that i can’t use and are not listed in htop process

after a wandering the web searching for clues in the matter i find the file /proc/meminfo, so i process it in calc i get the following table, i think that it must explain where is my 4 gb but i dont know what means anything below “swapCached”. some halp pls :frowning:
( i get this info whitout aplications running .)

MemTotal: 16265712 kB 15,884 mb 15.512 gb
MemFree: 9791528 kB 9,562 mb 9.338 gb
MemAvailable: 10221992 kB 9,982 mb 9.748 gb
Buffers: 41356 kB 40 mb 0.039 gb
Cached: 871020 kB 851 mb 0.831 gb
SwapCached: 0 kB 0 mb 0.000 gb
Active: 285484 kB 279 mb 0.272 gb
Inactive: 1568904 kB 1,532 mb 1.496 gb
Active(anon): 1560 kB 2 mb 0.001 gb
Inactive(anon): 1184752 kB 1,157 mb 1.130 gb
Active(file): 283924 kB 277 mb 0.271 gb
Inactive(file): 384152 kB 375 mb 0.366 gb
Unevictable: 115604 kB 113 mb 0.110 gb
Mlocked: 64 kB 0 mb 0.000 gb
SwapTotal: 0 kB 0 mb 0.000 gb
SwapFree: 0 kB 0 mb 0.000 gb
Dirty: 728 kB 1 mb 0.001 gb
Writeback: 0 kB 0 mb 0.000 gb
AnonPages: 1058036 kB 1,033 mb 1.009 gb
Mapped: 410836 kB 401 mb 0.392 gb
Shmem: 244020 kB 238 mb 0.233 gb
KReclaimable: 37956 kB 37 mb 0.036 gb
Slab: 113284 kB 111 mb 0.108 gb
SReclaimable: 37956 kB 37 mb 0.036 gb
SUnreclaim: 75328 kB 74 mb 0.072 gb
KernelStack: 10928 kB 11 mb 0.010 gb
PageTables: 17812 kB 17 mb 0.017 gb
NFS_Unstable: 0 kB 0 mb 0.000 gb
Bounce: 0 kB 0 mb 0.000 gb
WritebackTmp: 0 kB 0 mb 0.000 gb
CommitLimit: 6035704 kB 5,894 mb 5.756 gb
Committed_AS: 4098104 kB 4,002 mb 3.908 gb
VmallocTotal: 34359738367 kB 33,554,432 mb 32768.000 gb
VmallocUsed: 89700 kB 88 mb 0.086 gb
VmallocChunk: 0 kB 0 mb 0.000 gb
Percpu: 4736 kB 5 mb 0.005 gb
HardwareCorrupted: 0 kB 0 mb 0.000 gb
AnonHugePages: 0 kB 0 mb 0.000 gb
ShmemHugePages: 0 kB 0 mb 0.000 gb
ShmemPmdMapped: 0 kB 0 mb 0.000 gb
FileHugePages: 0 kB 0 mb 0.000 gb
FilePmdMapped: 0 kB 0 mb 0.000 gb
CmaTotal: 0 kB 0 mb 0.000 gb
CmaFree: 0 kB 0 mb 0.000 gb
HugePages_Total: 2048 2 mb 0.002 gb
HugePages_Free: 2048 2 mb 0.002 gb
HugePages_Rsvd: 0 0 mb 0.000 gb
HugePages_Surp: 0 0 mb 0.000 gb
Hugepagesize: 2048 kB 2 mb 0.002 gb
Hugetlb: 4194304 kB 4,096 mb 4.000 gb
DirectMap4k: 275136 kB 269 mb 0.262 gb
DirectMap2M: 6936576 kB 6,774 mb 6.615 gb
DirectMap1G: 9437184 kB 9,216 mb 9.000 gb
0 mb 0.000 gb

I am more inclined to think this is hardware related - somehow - I don’t know - but if you system is build with 4x4G modules and one is flaky - that would explain a lot.

So I suggest you start troubleshooting by pulling 3 blocks - and reboot to test.

If that is not possible then boot the system using memtest+ ISO and run some testing

sudo pacman -Syu memtest86-efi

reboot and hold Shift to access grub menu - select memtest

To get a more accurate ram usage by every processes, you can install ps_mem and run it as root.

Eg. in my case:

sudo ps_mem
 Private  +   Shared  =  RAM used	Program

380.0 KiB +  94.5 KiB = 474.5 KiB	rtkit-daemon
396.0 KiB +  80.5 KiB = 476.5 KiB	incrond
620.0 KiB + 135.5 KiB = 755.5 KiB	gvfsd-metadata
884.0 KiB + 110.5 KiB = 994.5 KiB	dconf-service
996.0 KiB + 382.5 KiB =   1.3 MiB	gvfsd
  1.0 MiB + 423.5 KiB =   1.5 MiB	gvfsd-trash
  1.2 MiB + 743.5 KiB =   2.0 MiB	systemd-logind
  1.7 MiB + 409.5 KiB =   2.1 MiB	thermald
  2.0 MiB + 465.5 KiB =   2.4 MiB	sudo
  2.4 MiB + 191.5 KiB =   2.6 MiB	picom
  2.9 MiB +  41.5 KiB =   2.9 MiB	xbindkeys
  2.3 MiB + 701.5 KiB =   2.9 MiB	upowerd
  2.4 MiB + 579.0 KiB =   3.0 MiB	dbus-daemon (2)
  3.0 MiB + 111.5 KiB =   3.1 MiB	xfconfd
  2.7 MiB + 626.5 KiB =   3.3 MiB	systemd-udevd
  3.2 MiB + 121.5 KiB =   3.4 MiB	gvfsd-fuse
  3.1 MiB + 624.5 KiB =   3.7 MiB	rngd
  4.0 MiB + 175.5 KiB =   4.2 MiB	accounts-daemon
  3.8 MiB + 610.5 KiB =   4.4 MiB	wpa_supplicant
  3.9 MiB + 796.0 KiB =   4.7 MiB	lightdm (2)
  4.2 MiB + 801.5 KiB =   5.0 MiB	gvfs-udisks2-volume-monitor
  6.7 MiB + 697.5 KiB =   7.3 MiB	polkit-gnome-authentication-agent-1
  6.8 MiB + 780.5 KiB =   7.6 MiB	udisksd
  6.9 MiB + 706.5 KiB =   7.6 MiB	xfce4-volumed-pulse
  7.0 MiB + 726.5 KiB =   7.7 MiB	xfce4-power-manager
  7.1 MiB + 837.5 KiB =   7.9 MiB	panel-19-systra
  7.4 MiB + 839.5 KiB =   8.2 MiB	xfce4-session
  7.4 MiB + 775.5 KiB =   8.2 MiB	Thunar
  7.9 MiB + 875.5 KiB =   8.7 MiB	python3.9
  7.4 MiB +   1.4 MiB =   8.8 MiB	NetworkManager
  7.8 MiB +   1.7 MiB =   9.5 MiB	xfce4-notifyd
  9.6 MiB + 564.5 KiB =  10.2 MiB	pulseaudio
  9.8 MiB + 900.5 KiB =  10.6 MiB	xfsettingsd
 10.7 MiB + 833.5 KiB =  11.5 MiB	xfce4-screensaver
 10.2 MiB +   1.8 MiB =  12.0 MiB	panel-15-power-
 11.1 MiB +   2.0 MiB =  13.0 MiB	xfce4-panel
 10.7 MiB +   2.3 MiB =  13.0 MiB	nm-applet
  8.9 MiB +   4.4 MiB =  13.4 MiB	systemd (3)
 11.8 MiB +   2.0 MiB =  13.8 MiB	conky (3)
 13.6 MiB + 791.5 KiB =  14.4 MiB	systemd-journald
 11.8 MiB +   2.8 MiB =  14.6 MiB	xfce4-terminal
 14.7 MiB +  74.5 KiB =  14.7 MiB	bash
 14.7 MiB + 320.5 KiB =  15.0 MiB	polkitd
 13.1 MiB +   2.2 MiB =  15.3 MiB	xfwm4
 14.2 MiB +   2.7 MiB =  16.8 MiB	panel-4-whisker
 14.8 MiB +   2.1 MiB =  17.0 MiB	panel-9-docklik
 18.9 MiB +   1.1 MiB =  20.0 MiB	xfdesktop
 25.3 MiB + 384.5 KiB =  25.7 MiB	plugin_host
 29.4 MiB +   3.2 MiB =  32.6 MiB	autokey-gtk
 29.6 MiB +   4.8 MiB =  34.4 MiB	gedit
 36.9 MiB +   2.3 MiB =  39.2 MiB	kdeconnectd
 33.5 MiB +   9.5 MiB =  43.0 MiB	Xorg
 83.2 MiB +  16.5 KiB =  83.2 MiB	dnscrypt-proxy
260.1 MiB +   8.7 MiB = 268.8 MiB	subl3
441.5 MiB + 101.6 MiB = 543.0 MiB	firefox (4)
---------------------------------
                          1.4 GiB

This is the result after a fresh reboot, after 8 minutes when I launched Firefox with many addons; I have 16 GB of RAM.

After some day of uptime, I can also reach 4 and more GB of used RAM, but especially high value of cache from free -h (also 10 GB of cache); the system is always smooth and reactive.

Yep - that is what the author of linux-ate-my-ram is trying to explain - Linux cache.

Yep: I want more used cache as my system can handle; in facts I set
vm.vfs_cache_pressure=5 and the system, as I’ve said here and elsewhere, is amazingly smooth and fast.

I use the same technique + I have enabled zswap too - and my experience is like yours … very good.

so i install and run ps_mem command but the showed info differ from the given by free or htop

 $ sudo ps_mem

 Private  +   Shared  =  RAM used	Program

412.0 KiB + 484.0 KiB = 896.0 KiB	xcape
...
 81.1 MiB + 105.7 MiB = 186.8 MiB	Xorg
---------------------------------
                          1.3 GiB
=================================

$ free
               total        used        free      shared  buff/cache   available
Mem:           15884        4789       10354          85         740       10730
Swap:          30719           0       30719