Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

GNOME memory leak discussion

Here you can discuss every aspect of Debian. Note: not for support requests!
Post Reply
Message
Author
Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

GNOME memory leak discussion

#1 Post by Wheelerof4te »

For years, GNOME has been regarded as a memory hog DE. And now, most of the public has learned a reason why:
GNOME devs work on a fix for large memory leak

Truth is, this has been known among the dev community for a long time. gnome-shell process will leak 1Mbit of RAM every few minutes. Worse, when using any action, such as displaying overview, memory will leak by a 0.1 Mbits. Just try to reproduce it by spamming "super" for a while. Then open System Monitor and see the RSS usage for gnome-shell.

GNOME dev has pinpointed a culprit, it's so-called "garbage collector". Read more about it in the article. If all goes well, a patch should be issued sometime after Ubuntu 18.04 releases, and should be ready for Debian 9.5 point-release.
Now, onto a more wider discussion. How did this bug remained unfixed for so long? Why didn't devs give priority to fixing it, since it was/still is giving GNOME such a bad reputation as a memory hog? How many more of such bugs exist in massive open-source projects like GNOME?

These are all questions for a more technically capable people than myself. But since GNOME is default for so many distros now, users have a right to know about these bugs and propose solutions that will prevent such rep-breaking bugs from incurring again.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: GNOME memory leak discussion

#2 Post by bw123 »

I think memory leaks are very common, and have been for a long time. There might be a lot of reasons for it, and on large projects that reuse a lot of code, especially a lot of old code, or code from different languages, or code from different programmers, I think it might be a lot harder to fix than we might assume.

I've never really thought about a massive memory leak as a "known issue" in gnome, but I haven't really used it.
resigned by AI ChatGPT

Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

Re: GNOME memory leak discussion

#3 Post by Wheelerof4te »

Yes, but most other leaks are often tied to performing specific commands or tasks in an application. And when that application is closed, the memory leak is gone. Here, we are talking about memory leak from a DE-related core process which is persistent. In other words, it can't be simply terminated without crashing entire session.

Yes, these kinds of leaks are hard to identify. But projects that impact a large number of users should focus on stability to minimize critical bugs. I don't think GNOME devs have thought much about stability for...a good while :D

Maybe GNOME devs should reconsider GNOME4 and focus on stabilizing and refining existing platform. Features could be added pro-actively.
EDIT: Removed some nonsense.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: GNOME memory leak discussion

#4 Post by debiman »

so basically the fix is not to fix the leak, but create another process that collects the garbage?
sounds typical.

apropos Gnome4.

Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

Re: GNOME memory leak discussion

#5 Post by Wheelerof4te »

https://gitlab.gnome.org/GNOME/gnome-sh ... note_91418
They have added an extension to "reduce the damage".

Another annoying bug related to Wayland and Mutter is also being worked on:
https://feaneron.com/2018/03/30/leak-hu ... r-hacking/

The issue is that on hybrid systems Mutter is waking the dGPU on every render, which causes the stutter. I reported this issue here a couple of days ago on my Intel/AMD hybrid laptop.

User avatar
None1975
df -h | participant
df -h | participant
Posts: 1387
Joined: 2015-11-29 18:23
Location: Russia, Kaliningrad
Has thanked: 45 times
Been thanked: 64 times

Re: GNOME memory leak discussion

#6 Post by None1975 »

Wheelerof4te wrote:For years, GNOME has been regarded as a memory hog DE.
Also, Gnome is a CPU hog...
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2063
Joined: 2010-06-07 16:59
Has thanked: 38 times
Been thanked: 221 times

Re: GNOME memory leak discussion

#7 Post by FreewheelinFrank »

Does this actually affect Gnome in Stretch? Show Applications bumps up RAM use quite a bit, and by going mad with the Super key and Alt Tab I can get usage up to 250-260MB, but at that point it just goes up and down by a few MB. I have not seen any incremental increase during the day, and memory use does not affect performance, even though I use a cheap low RAM/crap CPU computer that according to the review sites is laggy in Windows 10.

Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

Re: GNOME memory leak discussion

#8 Post by Wheelerof4te »

^Depends on your amount of RAM. For a crappy PC, that looks a lot for single process. IMO, the leak is present even in Stretch. It's a upstream bug that is left unfixed because of it's complexity.

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2063
Joined: 2010-06-07 16:59
Has thanked: 38 times
Been thanked: 221 times

Re: GNOME memory leak discussion

#9 Post by FreewheelinFrank »

I tried to reproduce the bug on my laptop- also running Stretch. Base usage is 95MB. There's a huge jump after clicking Show Applications (presumably due to Gnome caching the icon images in memory) up to about 260MB. Then by switching between windows with Alt Tab at a crazy rate for about a minute I could hit over 300MB, but always at some point memory usage dropped back to under 300MB.

I don't seem to be able to reproduce the inexorable rise some people have reported to several GB. Maybe you have to leave the computer running for several days as seems to be the case with people who have reported Gnome taking up all memory in the bug reports?

Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

Re: GNOME memory leak discussion

#10 Post by Wheelerof4te »

^Yes, most likely those people just put their PC's to sleep or use hibernation. I think it's better for hardware's health to turn them off every night when you sleep.

In other news, Sid has changed default GNOME session back to X due to the micro-stutter bug, it seems.

Code: Select all

Graphics:  Card-1: Intel HD Graphics
           Card-2: Advanced Micro Devices [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430]
           Display Server: x11 (X.Org 1.19.6 ) drivers: i915,radeon
           Resolution: 1366x768@60.02hz
           OpenGL: renderer: Mesa DRI Intel Broadwell GT1
           version: 4.5 Mesa 17.3.7

mooreted
Posts: 351
Joined: 2007-07-23 03:39

Re: GNOME memory leak discussion

#11 Post by mooreted »

My computer has been up for over 24 hours. It was up for several days before my last reboot. Gnome-shell is using 373.8 MB. I tried spamming super and show applications but it pretty much stays right there. I don't see the leak on my end.

Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

Re: GNOME memory leak discussion

#12 Post by Wheelerof4te »

^Are you using Stretch?
I seems that certain hardware configurations limit the leak to an acceptable level. Or Debian devs did something magical to reduce it.

mooreted
Posts: 351
Joined: 2007-07-23 03:39

Re: GNOME memory leak discussion

#13 Post by mooreted »

Yup, I'm using Stretch.

424.8 MB of RAM with Chrome open. No reboot since last post.

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 times

Re: GNOME memory leak discussion

#14 Post by Hallvor »

mooreted wrote:Yup, I'm using Stretch.

424.8 MB of RAM with Chrome open. No reboot since last post.
Try leaving it on for a few days.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

Re: GNOME memory leak discussion

#15 Post by Wheelerof4te »

It's using 142 MB on my Debian 9 system that's been running for 3 hours straight with casual usage.
Maybe when I shut it down, it reaches 200 MB. /s

So yeah, Debian has done something to it, or it doesn't exist in GNOME 3.22.

Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

Re: GNOME memory leak discussion

#16 Post by Wheelerof4te »

Bug with mutter micro-stuttering appears to be fixed. I don't experience any stuttering which is great. Wayland feels smoother now.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: GNOME memory leak discussion

#17 Post by pylkko »

Wheelerof4te wrote:It's using 142 MB on my Debian 9 system that's been running for 3 hours straight with casual usage.
So yeah, Debian has done something to it, or it doesn't exist in GNOME 3.22.

This bug has existed for 7 years and is now fixed and the fixes are accpeted for GNOME 3.30. There has been some talk about possibly backporting it to 3.28.

It is actually not even a memory leak, but a problem where objects in memory stay there too long (due to how javascript handles objects and how they were linked). They have fixed it by increasing the frequency of garbage collection (by queuing a garbage collection event every time an object is marked for destruction). The price here is that this will cause unnecessary processor work (though not that much) to get the memory to stay down in return. There will likely be better fixes later.

In detail:

https://feaneron.com/2018/04/20/the-inf ... mory-leak/

Post Reply