You are not logged in.

#1 2023-03-02 22:49:29

darce2
Member
Registered: 2023-03-02
Posts: 8

Help with debugging memory leak

Hi,

After resuming my system from suspend I notice my RAM usage climb pretty quickly until my system freezes.
I believe this started happening about a couple weeks ago but I haven't taken too much notice exactly when.
When I started using nvidia again I was having issues with suspend and followed the advice here to fix it with the service and shell script.

Edit: it does not seem to happen if waking from sleep on the same day.

Attached are the logs from when it was last happening. I believe it has something to do with gnome + wayland + nvidia and resuming from suspend.
Any advice on how to debug this or fix this would be greatly appreciated! Thank you!


drive link to logs

Last edited by darce2 (2023-03-02 22:55:29)

Offline

#2 2023-03-03 07:53:42

seth
Member
Registered: 2012-09-03
Posts: 51,229

Re: Help with debugging memory leak

Mar 02 16:06:11 darce gnome-software[1797]: Transaction: update flathub:runtime/org.freedesktop.Platform.GL.nvidia-515-65-01/x86_64/1.4[*]

WTF?

Offline

#3 2023-03-03 14:11:10

darce2
Member
Registered: 2023-03-02
Posts: 8

Re: Help with debugging memory leak

seth wrote:
Mar 02 16:06:11 darce gnome-software[1797]: Transaction: update flathub:runtime/org.freedesktop.Platform.GL.nvidia-515-65-01/x86_64/1.4[*]

WTF?


I was confused at these logs too. Seems like flatpak is running updates in the background and is my best guess on why it the memory climb. Can you explain more why it made you go wtf?

Offline

#4 2023-03-03 14:13:47

seth
Member
Registered: 2012-09-03
Posts: 51,229

Re: Help with debugging memory leak

Why is it downloading the nvidia driver?
Did you install the nvidia driver via flathub?

Offline

#5 2023-03-03 14:28:51

darce2
Member
Registered: 2023-03-02
Posts: 8

Re: Help with debugging memory leak

seth wrote:

Why is it downloading the nvidia driver?
Did you install the nvidia driver via flathub?

I am sure that I did not install the nvidia driver with it. bck-i-search reveals that I installed nvidia with pacman and not flatpak.

Im not sure what i did with flatpak as bck-i-search shows that I just installed it so I'm guessing it was for gnome or gnome extensions since I didn't do anything else with it.

Offline

#6 2023-03-03 14:35:44

seth
Member
Registered: 2012-09-03
Posts: 51,229

Re: Help with debugging memory leak

Can you assign the memory use to a specific process? ("top" will do)

Also

cat /proc/meminfo

Does the memory get freed when you restart gnome?

Offline

#7 2023-03-03 16:04:41

darce2
Member
Registered: 2023-03-02
Posts: 8

Re: Help with debugging memory leak

I will capture a top output when it happens again to see what process is responsible. I did run flatpak update yesterday evening to see if that would resolve it and so far it hasn't happened again (but might be too soon to tell since it didn't happen on ever suspend -> resume cycle). I might be able to use snapper to roll back to before i did the update if it doesn't end up happening anymore just to debug.


output of meminfo (i have huge pages reserved at the moment for vfio gpu passthrough):

MemTotal:       32786624 kB
MemFree:         5259932 kB
MemAvailable:    8634088 kB
Buffers:            2712 kB
Cached:          3834824 kB
SwapCached:            0 kB
Active:          3809080 kB
Inactive:        2458200 kB
Active(anon):    2029484 kB
Inactive(anon):   553652 kB
Active(file):    1779596 kB
Inactive(file):  1904548 kB
Unevictable:          32 kB
Mlocked:              32 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Zswap:                 0 kB
Zswapped:              0 kB
Dirty:              1056 kB
Writeback:             0 kB
AnonPages:       2319492 kB
Mapped:           747292 kB
Shmem:            153392 kB
KReclaimable:     111552 kB
Slab:             308340 kB
SReclaimable:     111552 kB
SUnreclaim:       196788 kB
KernelStack:       19808 kB
PageTables:        34240 kB
SecPageTables:         0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     6153312 kB
Committed_AS:   10138556 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      129976 kB
VmallocChunk:          0 kB
Percpu:            28288 kB
HardwareCorrupted:     0 kB
AnonHugePages:    821248 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:    151552 kB
FilePmdMapped:     61440 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:   10000
HugePages_Free:    10000
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:        20480000 kB
DirectMap4k:     1346516 kB
DirectMap2M:    12208128 kB
DirectMap1G:    20971520 kB

Offline

#8 2023-03-13 21:31:51

darce2
Member
Registered: 2023-03-02
Posts: 8

Re: Help with debugging memory leak

seth wrote:

Can you assign the memory use to a specific process? ("top" will do)

Also

cat /proc/meminfo

Does the memory get freed when you restart gnome?


The issue is back! The process is gnome-software --gapplication. Memory is free'd if I kill the process. I will attempt the next time to instead restart gnome.

imgur link to gnome process details of gnome-software --gapplication

Last edited by darce2 (2023-03-13 21:33:39)

Offline

#9 2023-03-13 21:39:34

seth
Member
Registered: 2012-09-03
Posts: 51,229

Re: Help with debugging memory leak

I will attempt the next time to instead restart gnome.

There's no need for that.

gnome-software has a long and sad record itr:
https://gitlab.gnome.org/GNOME/gnome-so … ge_size=20

Offline

#10 2023-03-13 21:48:01

darce2
Member
Registered: 2023-03-02
Posts: 8

Re: Help with debugging memory leak

seth wrote:

I will attempt the next time to instead restart gnome.

There's no need for that.

gnome-software has a long and sad record itr:
https://gitlab.gnome.org/GNOME/gnome-so … ge_size=20

Thanks for the pointer. Looks like i'll need to do some research on work arounds. Do you have any high level guidance on what is the most maintainable/easiest way to solve this?

Offline

#11 2023-03-13 22:04:21

seth
Member
Registered: 2012-09-03
Posts: 51,229

Re: Help with debugging memory leak

"pacman is your package manager"
Not using gnome-software will be a rather reliable way to prevent it from wasting resources.

There're plans to address the generally high RAM demand which is the base for closing various of the previously linked issues.
https://gitlab.gnome.org/GNOME/gnome-so … issues/942
It's apparantly autostarted and never quits because (a re-)startup would take so long because it's so fat… roll

Offline

#12 2023-03-14 02:16:55

darce2
Member
Registered: 2023-03-02
Posts: 8

Re: Help with debugging memory leak

seth wrote:

"pacman is your package manager"
Not using gnome-software will be a rather reliable way to prevent it from wasting resources.

There're plans to address the generally high RAM demand which is the base for closing various of the previously linked issues.
https://gitlab.gnome.org/GNOME/gnome-so … issues/942
It's apparantly autostarted and never quits because (a re-)startup would take so long because it's so fat… roll

Okay thanks! Does this mean you recommend not using gnome at all or just gnome-software? (assuming the latter includes extensions / stuff installed from their "software" app).

Offline

#13 2023-03-14 05:15:53

seth
Member
Registered: 2012-09-03
Posts: 51,229

Re: Help with debugging memory leak

Afaiu https://wiki.archlinux.org/title/GNOME#Extensions gnome-software isn't required to install gnome extensions?
I understood it to be some GUI for flathub and pacman (and the latter only along https://wiki.archlinux.org/title/GNOME/ … x_packages )

Offline

#14 2023-03-26 06:35:11

darce2
Member
Registered: 2023-03-02
Posts: 8

Re: Help with debugging memory leak

seth wrote:

Afaiu https://wiki.archlinux.org/title/GNOME#Extensions gnome-software isn't required to install gnome extensions?
I understood it to be some GUI for flathub and pacman (and the latter only along https://wiki.archlinux.org/title/GNOME/ … x_packages )

So I ended up disabling the autoupdate from the software store and that looked like it did the trick. Hasn't happened in a week where it was happening consistently every week.

In my digging I ended up reading that flatpak requires the nvidia drivers since anything installed from flatpak runs in a sandbox which is why it needs the drivers. Wanted to pass that along and double check my findings.

Thanks for all your help!

Offline

Board footer

Powered by FluxBB