You are not logged in.

#1 2025-05-30 04:31:40

develux
Member
Registered: 2024-05-26
Posts: 37

Abnormal memory usage

I noticed that starting from 6.14 kernel (and on 6.15 too) i get very strange ram usage
No apps are opened at all and it is using 8GB of ram
This happens by just using the device, regular Firefox browsing, coding and etc.
Screenshot of btop:
https://imgbox.com/uQarniw5
Is this memory leak or something somewhere?
It is using 4GB of ram already at system startup
Specs:
Ryzen 5 5625U with Vega 7 GPU, 32GB RAM, KDE Plasma, all latest updates are installed, Steam /dev/shm is cleaned, preload service disabled

Offline

#2 2025-05-30 04:44:57

cryptearth
Member
Registered: 2024-02-03
Posts: 1,470

Re: Abnormal memory usage

develux wrote:

It is using 4GB of ram already at system startup

can you share a screenshot after boot before open anything else
but using 8g out of 32g is no problem - that's what you have your 32g for
I use zfs so about half of my ram is always in use for its cache and with 16g to spare it's still plenty for all what I do - which is sometimes even run a couple of VMs the same time
so using up to half your mem shouldn't concern you - as long as it doesn't fill up over time

Offline

#3 2025-05-30 04:54:37

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

cryptearth wrote:
develux wrote:

It is using 4GB of ram already at system startup

can you share a screenshot after boot before open anything else

https://imgbox.com/3xIx4z2P
After few restarts

cryptearth wrote:

I use zfs

I am using XFS

Offline

#4 2025-05-30 06:18:17

seth
Member
Registered: 2012-09-03
Posts: 64,443

Re: Abnormal memory usage

Nice screenshots - but utterly useless.

cat /proc/meminfo

- early on and once you think your notice memory leaking away

No apps are opened at all and it is using 8GB of ram
This happens by just using the device, regular Firefox browsing, coding and etc.

So nothing but a chubby browser and an obese DE… tongue
These things can eat 8GB RAM easily, the kde file indexer (aptly named Baloo… smile ), alone can fill up your file cache.

Also

lspci

- notably amdgpu has shown up being very generous w/ GTT/GART
=> https://bbs.archlinux.org/viewtopic.php … 0#p2226310 (you can actively reclaim it)

Edit: give me my smiley, bbs.

Last edited by seth (2025-05-30 06:19:42)

Online

#5 2025-05-30 08:12:33

cryptearth
Member
Registered: 2024-02-03
Posts: 1,470

Re: Abnormal memory usage

hm, less then 3g after boot - that seems pretty normal - let the system use its resources
as for the previous shot: I have to agree with seth - I also summed up firefox to about 2gb on its own
as for plasma baloon indexer: unless you benefit from it by using the search often to find your files you can turn it off
otherwise can't see anything off

as for xfs vs zfs vs otthers: my point was to show that it can be normal to have a high resource usahe depending on your setup

Offline

#6 2025-05-30 18:29:41

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

It is 5GB now (only Konsole is opened)
https://imgbox.com/52olsqpy
Baloo disabled

Offline

#7 2025-05-30 19:31:37

seth
Member
Registered: 2012-09-03
Posts: 64,443

Re: Abnormal memory usage

Please don't link screenshots of text, post the text.

Online

#8 2025-05-30 19:43:33

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

seth wrote:

Please don't link screenshots of text, post the text.

Sure, my bad
http://0x0.st/83Uk.txt
Only konsole is opened again

Offline

#9 2025-05-30 20:06:36

seth
Member
Registered: 2012-09-03
Posts: 64,443

Re: Abnormal memory usage

~1.73GB are actually in userspace use (cache + anon pages) and ~450MB are sitting in kernel slabs.
~1.93GB are unaccounted for, have you tried to reclaim them as shown in the previous links (you'll have to leave the GUI for that, but this is just to check whether this is indeed GTT/GART - if this works, the memory is supposed to be handed back to you as much as the GPU can give up once you're under actual memory pressure)

One thing though, 666MB swap are used, zswap is disabled - are you (also) using a zram device for swap?
https://wiki.archlinux.org/title/Zram#Usage_as_swap

Iff it is indeed not GTT/GART try to add "transparent_hugepage=never" to the kernel parameters, but only after double and triple checking that it's not the GPU.

Online

#10 2025-05-31 02:41:37

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

seth wrote:

have you tried to reclaim them as shown in the previous links

Yes, I tried reclaiming it with

stress-ng --vm 1 --vm-bytes 31G

but no success, the memory usage returned to 5GB again. 

seth wrote:

are you (also) using a zram device for swap?

Yes, using zram as swap
I will check amdgpu_top GTT/VRAM usage report next time

Offline

#11 2025-05-31 04:27:27

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

http://0x0.st/83kD.txt
https://imgbox.com/lSTJx3Je
According to amdgpu_top, it is not GTT/VRAM fault
Also it cant be fixed with re-login in Plasma
EDIT: I didn`t play any games, just regular browsing and watching YouTube, but laptop went to deep sleep 2 times

Last edited by develux (2025-05-31 04:32:39)

Offline

#12 2025-05-31 07:19:04

seth
Member
Registered: 2012-09-03
Posts: 64,443

Re: Abnormal memory usage

You're lacking ~2GB again - "restarting plasma" actually does sound like GTT/GART - did you drop to the multi-user/rescue.target before trying to reclaim the memory? Does just dropping to the multi-user.target "fix" it?

df -h

Maybe some plasma-related cache in a tmpfs?

Online

#13 2025-05-31 08:28:27

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

seth wrote:

did you drop to the multi-user/rescue.target before trying to reclaim the memory? Does just dropping to the multi-user.target "fix" it?

I don`t know much about systemd yet. Does this mean that I need to kill sddm to get to tty and retry to reclaim the memory?
https://0x0.st/83nQ.txt
Only psd is active, asd already disabled

Offline

#14 2025-05-31 08:49:08

seth
Member
Registered: 2012-09-03
Posts: 64,443

Re: Abnormal memory usage

Does this mean that I need to kill sddm to get to tty and retry to reclaim the memory?

Possibly,  see the 2nd link below (but pointless if merely exiting plasma, w/o even restarting X11, "fixes" it)

systemctl isolate multi-user.target # this will immediately kill your GUI session!

Also

sudo journalctl | grep amdgpu

Online

#15 2025-05-31 09:37:29

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

seth wrote:
sudo journalctl | grep amdgpu

https://0x0.st/835-.txt
Will try that command when I notice memory consumption

Offline

#16 2025-05-31 15:15:42

seth
Member
Registered: 2012-09-03
Posts: 64,443

Re: Abnormal memory usage

Check the RAM there before trying to reclaim it (and then check it again)
When it comes to GTT

May 31 13:18:53 archlinux kernel: [drm] amdgpu: 15739M of GTT memory ready.

AMD affords itself half your RAM, you might want to try to limit that to "amdgpu.gttsize=1024", https://wiki.archlinux.org/title/Kernel_parameters and see whether that limits the leaks (nb. that depending on your framebuffer size and because of the GL-heavy plasma, you might run into VRAM troubles this way, resulting in black windows or so. It's just to test whether this has any impact at all)

Online

#17 2025-06-02 19:14:46

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

Perhaps the memory consumption should be like this, I will continue to monitor the memory. I'll let you know if I notice any pattern in it.

Offline

#18 2025-06-02 20:47:31

seth
Member
Registered: 2012-09-03
Posts: 64,443

Re: Abnormal memory usage

There's certainly unaccounted used RAM - if that's not the GPU, that's a kernel leak and not "should be like this".
If it is the GPU you should™ be able to reclaim it if the GPU doesn't require it (hence multi-user or rescue target to guarantee that this isn't because of some hungry GUI stuff)

Online

#19 2025-06-03 04:42:19

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

According to

systemd-cgtop -m

it is something in user slice
https://imgbox.com/bm55jQE6
Can this be caused by

vm.swappiness = 180
vm.watermark_boost_factor = 0
vm.watermark_scale_factor = 125
vm.page-cluster = 0
vm.vfs_cache_pressure=50

in

/etc/sysctl.d/99-vm-zram-parameters.conf

?

Last edited by develux (2025-06-03 04:44:14)

Offline

#20 2025-06-03 05:03:28

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

I tried

systemctl isolate multi-user.target

and tried reclaiming memory, but no success. I did

cat /proc/meminfo

while not having GUI session (from tty): http://0x0.st/8YWY.txt

Offline

#21 2025-06-03 05:09:03

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

Bruh. https://imgbox.com/skOipGvP
htop and neofetch show one memory usage, while btop and neofetch show other memory usage
htop and neofetch are showing normal memory usage. Maybe there is no problem at all with my system, but btop and fastfetch measure ram usage by other method?

Offline

#22 2025-06-03 06:21:57

seth
Member
Registered: 2012-09-03
Posts: 64,443

Re: Abnormal memory usage

The authoritative data is /proc/meminfo - #20 has ~840MB unaccounted for.

while not having GUI session (from tty)

To be clear: it's also not running? You dropped to the multi-user/rescue target and did NOT only just ctrl+alt+f3 while plasma was still running on the other tty?

The various aggregators will show different versions of what is "used" and "free", including or not disk caches and inactive pages. They're good for general monitoring (and whateverfetch is good for r/unixporn) but not for any kind of memory analysis.
If it's not the GART/GTT, have you tried to disable zram completely? "transparent_hugepage=never" ?

Online

#23 2025-06-03 14:33:46

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

seth wrote:

To be clear: it's also not running? You dropped to the multi-user/rescue target and did NOT only just ctrl+alt+f3 while plasma was still running on the other tty?

Plasma was not running, I was in tty1, I checked.

seth wrote:

have you tried to disable zram completely?

Yes, no effect. But I tried disabling it already in userspace right after reboot

sudo swapoff /dev/zram0
seth wrote:

"transparent_hugepage=never"

Not yet tried

Offline

#24 2025-06-03 17:53:14

topcat01
Member
Registered: 2019-09-17
Posts: 189

Re: Abnormal memory usage

develux wrote:

According to

systemd-cgtop -m

it is something in user slice
https://imgbox.com/bm55jQE6
Can this be caused by

vm.swappiness = 180
vm.watermark_boost_factor = 0
vm.watermark_scale_factor = 125
vm.page-cluster = 0
vm.vfs_cache_pressure=50

in

/etc/sysctl.d/99-vm-zram-parameters.conf

?

Can you revert this temporarily, reboot, and then post meminfo with no graphics running? I also use these settings, and (Total - Available), i.e., the difference between the first two lines is about 2GiB for all my machines (with 16+ GiB RAM). When these are turned off, the difference is much smaller.

Offline

#25 2025-06-03 18:13:27

develux
Member
Registered: 2024-05-26
Posts: 37

Re: Abnormal memory usage

After adding

transparent_hugepage=never

to cmdline: http://0x0.st/8YY4.txt
Issue is still there, plasma is running, other apps are closed

Offline

Board footer

Powered by FluxBB