Gnome shell has got big memory leaks.
FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,401

    Gnome shell has got big memory leaks.

    I read elsewhere in the web that someone had discovered memory leaks for gnome-shell
    I decided to see how bad it ws.

    I am running gnome with an application titled system. it displays something like this
    Process name, .... memory
    gnome-shell 295 when I started the monitor
    gnome-shell 300 when I started aisleriot freecell and exited asleriot freecell a loss of 6 megs each time
    gnome-shell 305 when I started aisleriot freecell and exited asleriot freecell a loss of 12 megs when two progs were run and exited
    gnome-shell 377 when I started firefox and then exited firefox. a loss of ram when Firefox exited after starting immediately after the 305 megs.

    I was wondering if gnome just keeps a largest area, and reuses it, but invoking a combination of firefox then aisleriot etc. showed ram consumption mounting monotonically.

    Interestingly, Dropbox does not use gnome-shell. I issued a "dropbox stop" and the memory used by same went to zero. Restarting dropbox with "dropbox start" returned it's footprint.
    Dropbox when running uses 101megs.

    Until the bug is discovered and repaired, you will not be able to run gnome 24/7. My 8gigs of system ram allows me to run all day without a system lockup. I wonder about those who have 4 gigs ram or even less ram? Will they experience crashes before end-of-day?
    Last edited by lsatenstein; 27th March 2018 at 04:02 AM.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  2. #2
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,401

    Re: Gnome shell is got big memory leaks.

    I have a comment to the above. After some thought, is it possible that aisleriot program is failing to return 6 megs ram at each exit? Then perhaps I discovered a problem with aisleriot?
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  3. #3
    Join Date
    Oct 2010
    Location
    Canberra
    Posts
    2,991

    Re: Gnome shell is got big memory leaks.

    I am running an older gnome (3.14) so things may have improved over my experience.

    However the gnome-shell certainly leaks like a sieve. On my system I have the clementine music player running continuously, and that also steadily leaks memory with each song it plays. The "System Monitor" program is another that steadily grows in memory size.
    They are all dwarfed by Firefox.

    I put the blame on languages like javascript that have garbage collection. The result of having gc is that programmers tend to neglect memory management and forget to clear cached data.

    Often the first symptom that too much memory has been used is that mouse clicks start to be ignored. There is then a small opportunity to restart gnome-shell. If I am not quick enough it also starts to ignore key presses, in which case the answer is the use Ctrl-Alt-F3, login, and send gnome-shell a SIGHUP to restart it.

    The worst case scenario is to try to switch users when too much memory has been allocated. This seems to crash gdm and leave a system that can only be re-booted. Hence I always restart the memory hogs before switching users.

    User error. Please replace user and try again

  4. #4
    Join Date
    Oct 2010
    Location
    Canberra
    Posts
    2,991

    Re: Gnome shell is got big memory leaks.

    Quote Originally Posted by lsatenstein
    I have a comment to the above. After some thought, is it possible that aisleriot program is failing to return 6 megs ram at each exit? Then perhaps I discovered a problem with aisleriot?
    If the memory isn't being reclaimed when the program exits it would be a problem with the kernel - it has the job of reclaiming all resources from terminating programs.

    User error. Please replace user and try again

  5. #5
    Join Date
    Feb 2018
    Location
    Europe
    Posts
    25

    Re: Gnome shell is got big memory leaks.

    It seems that it is a very old problem.
    I started a thread myself few weeks ago:
    https://forums.fedoraforum.org/showt...ll-memory-leak
    It seems that mutter was to blame:
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/64

    This was the reason I give up Gnome (even if I use it from 3.0). Now I use KDE and I do not think I am going back to Gnome very quickly.

    I tried Gnome 3.28 and there is still that problem.

  6. #6
    Join Date
    Dec 2013
    Location
    United Kingdom
    Posts
    6,384

    Re: Gnome shell has got big memory leaks.

    read what elsewhere leslie? a link to the source would be nice

  7. #7
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,401

    Re: Gnome shell has got big memory leaks.

    Hi Antikythera
    My inbox gets over 125 messages per day. I don't read them all. What happened is I read about the problem, there was a youtube video I watched showing a person clicking a gnome terminal and then exiting and redoing that action.

    It was a few days before I began to notice my situation with the gnome-shell. My posting is about a week after the original.

    Here is that link to the video. https://www.youtube.com/watch?v=zQCOO-9HZvU
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  8. #8
    Join Date
    Jun 2014
    Location
    Italy
    Posts
    107

    Re: Gnome shell has got big memory leaks.

    My gnome-shell doesn't leak memory .....
    Maybe it depends on the graphics or openGL drivers, did you try running gnome in Wayland and Xorg to see if only one backend shows signs of memory leaking?

  9. #9
    Join Date
    Feb 2018
    Location
    Europe
    Posts
    25

    Re: Gnome shell has got big memory leaks.

    I tried with Xorg and Wayland, Gnome 3.26 and 3.28, Fedora and another distro, there is memory leak. When Gnome starts, 107 mb, after 5 min. 320-370 mb and grow...... Never drops. My system: AMD Ryzen + Nvidia card.

  10. #10
    Join Date
    Jun 2014
    Location
    Italy
    Posts
    107

    Re: Gnome shell has got big memory leaks.

    Ok I left the PC running all night long and now gnome-shell uses 1.4G ram, there is definitely a memory leak

  11. #11
    Join Date
    Dec 2012
    Location
    santa barbara, CA
    Posts
    926

    Re: Gnome shell has got big memory leaks.

    OOP==OLP --> (object oriented programming == optimistically lazy plodding)

    EDIT: here is one I have found in my years of trying to fix their cr4p:
    Code:
    for (i=0; i< whatever; i++) {  
       int d=new();
       d=i*3;
       printf("wow: %d\n", d);
       /* and of course missing the:  free(d); here, typical lazyness */
    }
    whereas someone who thinks properly would do:
    int d=new();
    for (i=0; i< whatever; i++) {  
       d=i*3;
       printf("wow: %d\n", d);
    }
    free(d);
    saving the cpu from constantly allocating ram on each loop , etc.... endless examples like this
    pffffffff, they have no idea what they do to the users, how they burn them with their memory bloating cr4p.
    Last edited by bobx001; 31st March 2018 at 10:41 AM.
    "monsters John ... monsters from the ID..."
    "ma vule teva maar gul nol naya"

  12. #12
    Join Date
    Oct 2010
    Location
    Canberra
    Posts
    2,991

    Re: Gnome shell has got big memory leaks.

    @bobx001
    Memory leaks are not really related to OOP.
    On one project that my team took on to maintain, we converted from C to C++ and in the process removed all the memory leaks. The original developers had put quite a bit of code into the system to restart programs that died from some leak (memory, file handles, you name it). After our work the programs would run for months (processing many thousands of transactions per day) without any leaks.

    The examples you provided are typical of the sort of problems that can happen in any language with explicit freeing. However, such errors should not survive even a cursory code review. More typically what happens is that a function will normally free what it allocated, but sometimes executes an early return, skipping the free() call. I can imagine such code occurring in code that was intended for short lived programs, but getting re-purposed for a server. Of course Valgrind will find them and they can be fixed easily.

    Reading through some of the posts in the links the roadrunner provided indicates that the leaks in gnome-shell are rather more subtle. Their investigations are showing very little in the way of leaks that Valgrind complains about. My guess is that something is being cached and the garbage collector in javascript is never detecting that it can be freed. There might also be a memory fragmentation problem, but modern memory allocators are quite good at handling those problems unless you hit a pathological case.

    User error. Please replace user and try again

  13. #13
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,401

    Re: Gnome shell has got big memory leaks.

    Hi Bob

    Many times the authors(programmers) are young computer scientists on a "stage of 16 weeks typical". They have 16 weeks to develop, document and deliver some code. Their mentor may not look in detail at their code and as a result, knowing human nature., post implementation, the fun begins...
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  14. #14
    Join Date
    Jun 2014
    Location
    Italy
    Posts
    107

    Re: Gnome shell has got big memory leaks.

    Things were probably a bit more complicate than a typo, but well it appears that the infamous 'gnome memory leak' has been fixed (spoiler: it wasn't a typo made by a student)

    https://feaneron.com/2018/04/20/the-...l-memory-leak/

  15. #15
    Join Date
    Aug 2011
    Location
    ~
    Posts
    1,943

    Re: Gnome shell has got big memory leaks.

    Memory leaks? In Gnome-shell? And the devs are looking into it? Did hell freeze over?
    So apparently their fix is to kick off the GC after every deletion. Yeah, I am confident that they will fix the performance issues for once and for all. :')

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Memory usage gnome-shell
    By aghorash in forum Using Fedora
    Replies: 14
    Last Post: 16th March 2016, 03:10 AM
  2. gnome-shell memory consumption
    By mario123 in forum Using Fedora
    Replies: 1
    Last Post: 16th April 2015, 08:34 PM
  3. Memory leaks in a conky lua plugin
    By elija in forum Programming & Packaging
    Replies: 1
    Last Post: 15th May 2014, 06:18 PM
  4. F18: gnome-shell memory leak?
    By borispr in forum Using Fedora
    Replies: 3
    Last Post: 8th February 2013, 12:21 AM
  5. Detecting memory leaks
    By martind1111 in forum Programming & Packaging
    Replies: 1
    Last Post: 19th October 2005, 05:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •