linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.39k stars 724 forks source link

Memory usage increasing over time #6850

Open MegaV0lt opened 6 years ago

MegaV0lt commented 6 years ago
 * Cinnamon 3.4.6
 * Linux Mint 18.2 Sonya
 * Graphics:  Card: Advanced Micro Devices [AMD/ATI] Kaveri [Radeon R7 Graphics] bus-ID: 00:01.0
           Display Server: X.Org 1.18.4 drivers: ati,radeon (unloaded: fbdev,vesa)
           Resolution: 1920x1200@59.95hz
           GLX Renderer: Gallium 0.4 on AMD KAVERI (DRM 2.49.0 / 4.10.0-32-generic, LLVM 4.0.0)
           GLX Version: 3.0 Mesa 17.0.7 Direct Rendering: Yes

 * 64 bit

Memory usage increasing over time

Steps to reproduce Memory increases slowly the more time is running

Expected behaviour No memory increasing

Other information auswahl_20170826_09 42 01

kyleguarco commented 6 years ago

I can confirm this, if no one else wants to. The same thing happens on my system, it's a memory leak that people using Mint have been LONG aware of. There's a workaround currently, but it's only temporary.

cinnamon --replace does the job for about an hour.

MegaV0lt commented 6 years ago

I think most people do not see the memorywaste. I also hve seen it only because conky was showing it.

PS: I also had crashes in cinamon, but do not know if is connected to the memoryusage

LightningStalker commented 6 years ago

It's not only cinnamon itself, but also cinnamon-screensaver. When cinnamon gets above 3GB, cinnamon-screensaver is around 1GB, and it starts becoming a real issue. The system becomes noticeably slower as memory starts paging to the hard disk.

SerafDosSantos commented 6 years ago

Please pay attention to those applets, they're often the culprits. I removed most of them and didn't get any problems afterwards.

LightningStalker commented 6 years ago

Don't be so quick to blame those applets. I'm not running any.

magnetx commented 6 years ago

I see memory consumption increasing, too. When I start any program, cinnamon process takes a piece of memory. And when I close that progam, cinnamon process memory value isn't back. Actually, it decreases, but not to the value it was before starting program.

theraser commented 6 years ago

This issue seems to be a duplicate of https://github.com/linuxmint/Cinnamon/issues/3796, right? Maybe we could move the discussion the other issue :)

brownsr commented 6 years ago

I pushed a memory leak fix recently https://github.com/linuxmint/Cinnamon/commit/5cdf5c07966f9827ba427447ba00b997c6798ac1

LightningStalker commented 6 years ago

That would be great if it fixes this. Even if it just slows down the leak.

cmrdt commented 6 years ago

as an alternative to cinnamon --replace there's also the GUI option (inside "panel > context-menu > troubleshooting >restart-cinnamon")

clipboard03

leigh123linux commented 6 years ago

@cmrdt

There's also a key combo

Ctrl+Alt+Esc

LightningStalker commented 6 years ago

@cmrdt @leigh123linux Or Alt+F2, r Unfortunately, restarting a desktop manager has the annoying side effect of moving all the open program tabs around.

abdouskamel commented 6 years ago

Just want to notice that i have not this problem in debian. After 2 hours, cinnamon is still below 300mo of memory usage. Maybe it's about my environment, or the problem is specific to mint ?

LightningStalker commented 6 years ago

@abdouskamel it grows to around 900Mb by 24h on my system.

abdouskamel commented 6 years ago

@LightningStalker Are you in debian ? For myself, memory usage is the same when booting and after hours of working.

LightningStalker commented 6 years ago

@abdouskamel mint, after a restart yesterday, it is currently 696MB, cinnamon-screensaver is 106.7MB, both going up

abdouskamel commented 6 years ago

@LightningStalker It appears that it's bound to mint, isn't it ?

lopesmaio commented 6 years ago

@abdouskamel I guess not; Antergos user here, same issue.

C0rn3j commented 6 years ago

I have no issues running Cinnamon over 4GB of RAM in a day or two of uptime.

image

I do have some applets installed though, will have to retest without them.

LightningStalker commented 6 years ago

After a RAM upgrade I'm currently thinking of ways to make this into a game. The first stage is to let it run and see how large it gets.

As a sidenote, the right panel "tray" has stopped working properly. Deleting some cache and settings files and restarting has no effect. Maybe I'm not deleting the right files. Does anyone know how to reset it? 33858759-03cf8806-de9f-11e7-98f3-9adc6d313dd8

leigh123linux commented 6 years ago

Can you lot start posting some useful info eg system info? and more, The quality of info provided so far in this report is total crap!

P.S The next 'me to' or 'same here' remark and I will close it.

austin987 commented 6 years ago

@leigh123linux,

In my 3.5 year old bug report that was closed as a duplicate of this (#2986), I included a simple testcase:

#!/bin/bash

while true ; do
xeyes & sleep 1 & killall xeyes
done

that reliably showed the issue. If a testcase isn't good enough info, I don't see how berating users will get you better info.

Good luck fixing it.

PaulVD commented 6 years ago

Leigh, you closed #7121 where there were some system info dumps, as being a duplicate of this one. You said there that there is no proof this is a Cinnamon issue; all you see is a crappy Xenial base and an old Xorg. That could well be true, but this is a LinuxMint forum, and those are the current Mint versions. And it is Cinnamon, not Xorg, that runs its CPU usage to 100% and freezes the interface (and yes, I understand that the root cause of this behaviour may be elsewhere). I would like to help, but I am only a user, not a developer. What information beyond what was supplied in #7121 would be useful to you, at least to help find out whether Cinnamon or something else is at fault? (A pointer to a list somewhere else would be great.)

leigh123linux commented 6 years ago

@austin987 I tried your test 3.5 years ago and it didn't increase memory use then and it still doesn't.

I don't see how berating users

Perhaps if you received 30-50 worthless emails a day that say little more than 'me to' , 'same here' , '+1' or some abrt report without info you would have a hardened attitude.

leigh123linux commented 6 years ago

@PaulVD I closed #7121 as more than 50% were using monitoring applets, these are known to cause high memory use.

all you see is a crappy Xenial base and an old Xorg.

What I meant by this is, old software versions don't get upstream fixes as such, maybe the odd security fix.

but this is a LinuxMint forum

It isn't a forum, it's a bug tracker for issues and we expect a higher standard of reporting.

I would like to help, but I am only a user, not a developer. What information beyond what was supplied in #7121 would be useful to you, at least to help find out whether Cinnamon or something else is at fault? (A pointer to a list somewhere else would be great.)

I would like to see

  1. reporters to remove all spice applets, desklets, extensions and set the theme to Mint default and see if the memory still leaks.
  2. full system info paste and some hardware info
  3. Can anyone confirm they have actually run out of RAM due to this?, linux tends to cache and release when needed.
austin987 commented 6 years ago

I'm an active developer/maintainer on several FOSS products, so yes, I do get plenty of emails to that effect.

Given that this bug has gotten nothing but vitrol and blaming users, I voted with my feet and moved to xfce years ago, which doesn't have any similar issue. Still, I would be willing to help debug this, as I already have a couple times in the past years. But given the replies and attitude towards users, it's easier to drop it and contribute where I'm wanted.

okornev commented 6 years ago
  1. Removed all applets, desklets, extensions and set theme to default.
  2. System info: https://gist.github.com/anonymous/3bad51e14ce76470d4e1c3b66e3d2fbe
  3. Completely running out of ram would take quite some time since memory usage increase happens over time and once cinnamon reaches 3-4 gig limit most users restart cinnamon/box because system becomes very sluggish, but here is a screencast of me repeatedly switching from one window to another that increases cinnamon ram usage ~1.5 times in a matter minutes. https://youtu.be/1pv32MQvXgM While working normally, I have to restart (Ctrl-Alt-Esc) cinnamon at least once every day otherwise cinnamon process starts to eat 3-4 gigs of ram and slows down significantly. Even with linux tendencies to cache you would think this is excessive for a windows manager.

Now that I think about it is it possible that cinnamon windows switcher alt-tab has a leak? I don't see any memory increase by switching from one window to another by calling wmctrl in a loop

#!/bin/bash
for loop in {0..10000}
do
 wmctrl -Fa 'System Monitor'
 wmctrl -Fa 'Terminal'
done 

Yet while switching manually I went from 70mb to 100mb in a matter of minutes.

And by the time I was done writing this post memory usage was already at ~150mb.

Elemag commented 6 years ago

Cinnamon on my office computer accumulated 7.5 GB over the weekend. So it's not the alt-tab swtich either.

LightningStalker commented 6 years ago

Here is the output of lshw on my system. hw.txt If you mean run out of RAM to the point where it starts paging everything to disk, the HD light is on solid and everything is slow to the point of being ususable, then yes, due to the cumulative effect of cinnamon and other programs running on the system.

IlyukhinAndrey commented 6 years ago

Hello guys. My -cinnamon process grow up to 4,7Gb during the weekend ))) I solved the issue. In my case the reason of problem were the GPU and CPU temperature applets in status bar. I didn`t try to define witch one is bad, but when I turned it off and restart -cinnamon it was finished to increase in memory. So if any body have such problem, try to turn OFF this applets: gputemperature@silentage.com or/and temperature@fevimu, or something like that...

2017-12-18 09-44-52

sboukortt commented 6 years ago

In my case, the problem also happens when the SpiderOak ONE client is uploading stuff and its systray icon gets animated, so the problem might be in the Cinnamon code that handles systray icons in general rather than one applet in particular.

IlyukhinAndrey commented 6 years ago

@sboukortt It is really looks like! During I tried to find solution, I have read that some people meet the same problems with different applets for -Cinnamon like: "Shutdown menu with icons", "CPU Temperature", "GPU temperature", etc.

PaulVD commented 6 years ago

Leigh, thanks for the list of what you needed. I was using only applets provided by the distribution, but when I disabled them all as you requested then the problem disappeared. So I can now identify the applet at fault and send the information where it will do some good. Your debugging advice was greatly appreciated.

LightningStalker commented 6 years ago

Including network and clock, etc?

astephanh commented 6 years ago

For me it seems to be the cpu temperature applet. how can i dump and analyse the memory of the cinnamon process?

sobrus commented 6 years ago

I've been experiencing the same problem ever since I've came from MATE in may. Cinnamon grows bigger and will eventually consume 800MB+ when left overnight. Moreover, cinnamom performance (moving windows etc) drops dramatically then - until restarted.

I think that every element that causes redraw is to blame. You can disable applets that draw anything on screen (like monitoring applets) but you will eventually only postpone or rather slow down uneviteable growing of cinnamon process. Even calendar applet draws seconds (in my case) or minutes anyway. Calendar is the last "fancy" applet I got and cinnamon is already 220MB after one hour of light usage (315MB RSS). Up from about 90MB and still growing.

And I'm on Manjaro btw, so it's not any Mint related issue. There is no point in denying that there is a problem, because there IS a problem. Disabling applets or turning software renderer ultimately won't help. Looking at issue #3796 nothing has changed since at least 2015.

edit: and here is short movie titled "how to increase cinnamon memory usage from 80MB to 200MB in 8 minutes without any apps". Of course it won't stop at 200MB, but my finger hurts ;) https://warps.ml/github/cinnamon.mp4 Cinnamon 3.6.6, X.Org 1.19.5, Linux 4.14.5, nVidia 384.98, backends gl3, gl, software

edit2: https://github.com/linuxmint/Cinnamon/commit/5cdf5c07966f9827ba427447ba00b997c6798ac1 Will it be incuded in 3.6.7?

edit3: also, reloading applet (for example Cinnamon stock main menu) from Melagnge/Looking Glass console causes approx. 5MB increase for each reload. Just like memory is always allocated, never freed.

LightningStalker commented 6 years ago

Well, cinnamon-screensaver has stopped working completely, so I have to restart it, but here is a record of how high it got. screenshot from 2017-12-22 10-10-22

leigh123linux commented 6 years ago

@sobrus I noted all his processes were using more than they should.

2

And I'm on Manjaro btw, so it's not any Mint related issue. There is no point in denying that there is a problem, because there IS a problem. Disabling applets or turning software renderer ultimately won't help. Looking at issue #3796 nothing has changed since at least 2015

Who is denying there is a problem?, Memory usage has improved since 2015 here, initial usage has halved here.

Does gnome-shell leak less? cjs/gjs has never be good at freeing IMO

edit3: also, reloading applet (for example Cinnamon stock main menu) from Melagnge/Looking Glass console causes approx. 5MB increase for each reload. Just like memory is always allocated, never freed.

sobrus commented 6 years ago

I don't know about gnome-shell (I don't like it, that's why cinnamon was created anyway), but to be honest kwin and deepin both seem to grow. But they shouldn't grow inifinitely (and I hope they don't. Mate, Xfce doesn't grow even with compiz).

Moreover, Cinnamon performance suffer after longer period too (and one day isn't much, considering I restart my crappy Windows7 box at job once two months just because updates require it). Not to mention it should work as expected with all themes/applets downloaded from official spices store. That's why - in my opinion - this is a big issue, and should be fixed ASAP. Even instead of new features.

Maybe someone should try using applet that is known to misbehave, see WHY it causes cinnamon to grow and implement some kind of protection? Or garbage collector maybe? Or spawn separate processes for applets just like gnome2 did. It would be probably more useful that splitting settings daemon... If it is really applet problem, not core gnome-shell technology related issue. It would be even higher priority for me in such case. 6 years after gnome 3 introduction it'd be quite ... embarassing.

leigh123linux commented 6 years ago

@sobrus

Spice isn't official, there are no guarantees that they will work.

Not to mention it should work as expected with all themes/applets downloaded from official spices store

skylarmt commented 6 years ago

A couple times, I've left my PC on overnight with a bunch of stuff open and came back to Cinnamon in fallback mode, and dmesg shows it had been killed for using all the memory.

Just now Cinnamon was using almost 4GB, until I did this suggestion by @cmrdt. Look at my memory usage before and after, and this was with a bunch of stuff open, including Netbeans IDE, Firefox (with about a dozen tabs), Thunderbird, Nextcloud Desktop (syncing my entire ~100GB home folder), Steam, and Bitcoin Core. Out of all those things, Cinnamon was using the most RAM!

sobrus commented 6 years ago

I can only confirm, that 3.6.7 doesn't fix this issue. @skylarmt Maybe try placing this script in autostart until it is fixed. It will restart cinnamon automatically once it grows too large (change 400000kiB to value appropriate for your system)

#!/bin/sh
while true
do
  sleep 600
  PID=$(pidof cinnamon)
  MEM=$(cat /proc/$PID/status | grep RssAnon | awk '{print $2}')

  if [ "$MEM" -gt "400000" ]
  then
    cinnamon --replace &
  fi
done
ctrlesc commented 6 years ago

I've noticed this issue for a while and thought I'd chime in to see if this helps. I am the author of the "iodisk" spice which displays disk utilization in the panel. I have a mix of Mint 17.3 and 18.3 machines none of which are identically configured in HW or SW. I have a mint 17.3 box which had not been updated or rebooted since May 2017 running the same interactive cinnamon session with the iodisk spice when I updated and rebooted the box on Dec 21, 2017. The glass.log did not reflect any cinnamon crashes, and cinnamon was consuming 135MB . As an anecdote, the Mint 18.3 boxes I use regularly all appear to suffer from the memory leak issue, and the shell crashes every few days. Spot checking memory usage for cinnamon often shows memory usage in the GB ranges.

As a test, I created two identically configured VirtualBox VMs and booted from the latest ISOs for 17.3 and 18.3. No updates were installed. I only installed sysstat (with the required dependencies) and iodisk from the online spice repository and let each VM run over night. Results below:

17

18

Please advise if I can be of additional service in this matter.

Regards

sobrus commented 6 years ago

Nice finding!. I've installed Cinnamon 3.2.x on VirtualBox (Manjaro Cinnamon 17.0.1 from march) and after 4 hours usage jumped to about only 125MB. I've tried to increase it further, but it every time it returned back to about 130. Just like some kind of garbage collector was launched and this isn't the case with 3.6.7. I never used version 3.2 - started with 3.4.

@ctrlesc Nice applet btw. First that actually works with mdadm raid :)

ctrlesc commented 6 years ago

Based on the comment by @sobrus, I ran the same tests on Mint 18.1 & 18.2 using the same methodology as in my previous post. The cinnamon instances in each test started at just under 100MB and ran over night. It appears the regression was introduced in cinnamon 3.4 as sobrus alluded to above. Based on the conversation in this thread and these tests, it appears that applets which poll values via shell execution and update the panel regularly (iodisk polls every 2 seconds) may exacerbate the memory leak.

screenshot from 2018-01-07 18-28-54 screenshot from 2018-01-07 18-29-13

leigh123linux commented 6 years ago

Linuxmint cinnamon seems ok so far, I will see if I can last 24 hours without returning to fedora :-)

leigh@leigh-main-pc ~ $ uptime
 17:53:05 up  4:13,  1 user,  load average: 0.24, 0.21, 0.18
leigh@leigh-main-pc ~ $ inxi -GSC
System:    Host: leigh-main-pc Kernel: 4.10.0-42-generic x86_64 (64 bit)
           Desktop: Cinnamon 3.6.7  Distro: Linux Mint 18.3 Sylvia
CPU:       Octa core AMD FX-8350 Eight-Core (-MCP-) cache: 16384 KB 
           clock speeds: max: 4500 MHz 1: 1400 MHz 2: 2100 MHz 3: 2100 MHz
           4: 1400 MHz 5: 1400 MHz 6: 2100 MHz 7: 2100 MHz 8: 2800 MHz
Graphics:  Card: NVIDIA Device 1c82
           Display Server: X.Org 1.18.4 drivers: nvidia (unloaded: fbdev,vesa,nouveau)
           Resolution: 3840x2160@60.00hz
           GLX Renderer: GeForce GTX 1050 Ti/PCIe/SSE2
           GLX Version: 4.5.0 NVIDIA 384.90
leigh@leigh-main-pc ~ $ top

top - 17:53:53 up  4:14,  1 user,  load average: 0.10, 0.17, 0.17
Tasks: 252 total,   1 running, 250 sleeping,   0 stopped,   1 zombie
%Cpu(s):  0.9 us,  0.3 sy,  0.0 ni, 98.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 16392628 total, 11590252 free,  3197728 used,  1604648 buff/cache
KiB Swap:  3923964 total,  3923964 free,        0 used. 12626828 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
 2937 leigh     20   0 2466304 434008 182944 S   1.7  2.6   2:18.78 Web Content 
 2989 leigh     20   0 2348076 405508 152716 S   1.7  2.5   1:49.37 thunderbird 
 1948 leigh     20   0 2731720 437992  89780 S   1.0  2.7   7:58.60 cinnamon    
 4387 leigh     20   0 2183352 300032 111052 S   1.0  1.8   2:32.51 Web Content 
 4521 leigh     20   0 2285620 290212 116748 S   0.7  1.8   3:48.26 Web Content 
 7550 leigh     20   0   41952   4032   3312 R   0.7  0.0   0:00.07 top         
    7 root      20   0       0      0      0 S   0.3  0.0   0:04.43 rcu_sched   
   26 root      rt   0       0      0      0 S   0.3  0.0   0:00.03 watchdog/3  
  943 root     -51   0       0      0      0 S   0.3  0.0   1:34.25 irq/51-nvi+ 
 1220 root      20   0  576244 199508 174628 S   0.3  1.2   5:52.85 Xorg        
 2766 leigh     20   0 2975264 788184 281228 S   0.3  4.8   8:19.68 firefox     
 3068 leigh     20   0  822436 160292 102136 S   0.3  1.0   2:30.49 kvirc       
 7375 leigh     20   0  493612  36076  28924 S   0.3  0.2   0:00.38 gnome-term+ 
    1 root      20   0  185620   6388   4132 S   0.0  0.0   0:01.78 systemd     
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kthreadd    
    4 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:+ 
    6 root      20   0       0      0      0 S   0.0  0.0   0:00.07 ksoftirqd/0 
leigh@leigh-main-pc ~ $
leigh123linux commented 6 years ago

Nearly there. Still no leak or if there is it's tiny.

leigh@leigh-main-pc ~ $ uptime
 07:06:43 up 17:26,  1 user,  load average: 0.04, 0.07, 0.05
leigh@leigh-main-pc ~ $ top

top - 07:06:58 up 17:27,  1 user,  load average: 0.04, 0.07, 0.05
Tasks: 263 total,   1 running, 260 sleeping,   0 stopped,   2 zombie
%Cpu(s):  0.9 us,  0.2 sy,  0.0 ni, 98.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 16392628 total,  9956568 free,  4468292 used,  1967768 buff/cache
KiB Swap:  3923964 total,  3923964 free,        0 used. 11242756 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
11026 leigh     20   0 2491260 362964 134324 S   2.6  2.2  14:11.59 Web Content 
10802 leigh     20   0 2606328 662656 137212 S   1.7  4.0   9:57.74 Web Content 
10670 leigh     20   0 3001608 573856 238412 S   1.3  3.5  16:04.80 firefox     
 1864 leigh      9 -11  509100  17100  13672 S   0.7  0.1   3:18.85 pulseaudio  
 1948 leigh     20   0 2908832 562348  89808 S   0.7  3.4  22:30.10 cinnamon    
10839 leigh     20   0 2184848 419608 227044 S   0.7  2.6   3:24.71 Web Content 
10939 leigh     20   0 2398660 429736 107812 S   0.7  2.6   9:05.98 Web Content 
 1220 root      20   0  624060 246588 221708 S   0.3  1.5  18:36.45 Xorg        
 3068 leigh     20   0  829880 166152 102200 S   0.3  1.0   5:02.06 kvirc       
10727 leigh     20   0 2162044 246276 100608 S   0.3  1.5   2:36.40 Web Content 
10935 leigh     20   0 1975836 213528  94908 S   0.3  1.3   1:55.89 Web Content 
16321 leigh     20   0   41960   4044   3312 R   0.3  0.0   0:00.04 top         
    1 root      20   0  185620   6388   4132 S   0.0  0.0   0:01.96 systemd     
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.01 kthreadd    
    4 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:+ 
    6 root      20   0       0      0      0 S   0.0  0.0   0:00.35 ksoftirqd/0 
    7 root      20   0       0      0      0 S   0.0  0.0   0:15.79 rcu_sched   
leigh@leigh-main-pc ~ $
sobrus commented 6 years ago

Wouldn't it be easier to reproduce issue using VBox and applet povided by ctrlesc? Cinnamon takes almost 600MiB, is this normal for 2160p?

leigh123linux commented 6 years ago

@sobrus No, I'm not interested in third-party applets issues.

sobrus commented 6 years ago

And this doesn't seem to be an applet issue. Removing applet is rather just a workaround for cinnamon issue.