cinnamon runaway memory problem

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
dhdurgee
Level 4
Level 4
Posts: 434
Joined: Thu Jul 02, 2009 7:56 pm

Re: cinnamon runaway memory problem

Post by dhdurgee »

JosephM wrote: Tue May 18, 2021 5:11 pm If all of you seeing this problem are using the Places Manager applet, could you try removing it and seeing if you see the same problem keep happening?
I don't recognize an applet by that name. Here is my cinnamon startup log:

Code: Select all

Cjs-Message: 17:51:12.339: JS LOG: About to start Cinnamon
Cjs-Message: 17:51:12.409: JS LOG: [LookingGlass/info] Cinnamon.AppSystem.get_default() started in 64 ms
Cjs-Message: 17:51:12.429: JS LOG: [LookingGlass/info] loading user theme: /usr/share/themes/Mint-Y-Dark/cinnamon/cinnamon.css
Cjs-Message: 17:51:12.455: JS LOG: [LookingGlass/info] added icon directory: /usr/share/themes/Mint-Y-Dark/cinnamon
Cjs-Message: 17:51:12.717: JS LOG: [LookingGlass/info] loaded at Sun May 16 2021 17:51:12 GMT-0400 (Eastern Daylight Time)
Cjs-Message: 17:51:12.718: JS LOG: Cinnamon started at Sun May 16 2021 17:51:12 GMT-0400 (Eastern Daylight Time)
Cjs-Message: 17:51:12.738: JS LOG: [LookingGlass/info] ExtensionSystem started in 1 ms
Cjs-Message: 17:51:12.738: JS LOG: [LookingGlass/info] DeskletManager started in 1 ms
Cjs-Message: 17:51:12.738: JS LOG: [LookingGlass/info] SearchProviderManager started in 1 ms
openGL version 2.1 Mesa 20 detected (GL Cogl Driver)
MetaSyncRing disabled: couldn't find required GL extensions, or the minimum safe openGL version was not met
Cjs-Message: 17:51:13.151: JS LOG: [LookingGlass/info] Loaded applet show-desktop@cinnamon.org in 110 ms
Cjs-Message: 17:51:13.167: JS LOG: [LookingGlass/info] Role locked: tray
Cjs-Message: 17:51:13.208: JS LOG: [LookingGlass/info] Loaded applet systray@cinnamon.org in 56 ms
Cjs-Message: 17:51:13.227: JS LOG: [LookingGlass/info] Loaded applet favorites@cinnamon.org in 18 ms
Cjs-Message: 17:51:13.316: JS LOG: [LookingGlass/info] Loaded applet calendar@cinnamon.org in 89 ms
St-Message: 17:51:13.327: cogl npot texture sizes SUPPORTED
Cjs-Message: 17:51:13.346: JS LOG: [LookingGlass/info] Role locked: notifications
Cjs-Message: 17:51:13.367: JS LOG: [LookingGlass/info] Loaded applet notifications@cinnamon.org in 51 ms
Cjs-Message: 17:51:13.404: JS LOG: [LookingGlass/info] Loaded applet keyboard@cinnamon.org in 37 ms
Cjs-Message: 17:51:13.432: JS LOG: [LookingGlass/info] Loaded applet temperature@fevimu in 28 ms
Cjs-Message: 17:51:13.473: JS LOG: [LookingGlass/info] Loaded applet settings@cinnamon.org in 41 ms
Cjs-Message: 17:51:13.498: JS LOG: [LookingGlass/info] Loaded applet removable-drives@cinnamon.org in 24 ms
Cjs-Message: 17:51:13.507: JS LOG: [LookingGlass/info] Loaded applet xapp-status@cinnamon.org in 9 ms
Cjs-Message: 17:51:13.574: JS LOG: [LookingGlass/info] Loaded applet printers@cinnamon.org in 66 ms
Cjs-Message: 17:51:13.694: JS LOG: [LookingGlass/info] Loaded applet multicore-sys-monitor@ccadeptic23 in 118 ms
Cjs-Message: 17:51:13.721: JS LOG: [LookingGlass/info] Loaded applet power@cinnamon.org in 27 ms
Cjs-Message: 17:51:13.772: JS LOG: [LookingGlass/info] Role locked: panellauncher
Cjs-Message: 17:51:13.778: JS LOG: [LookingGlass/info] Loaded applet grouped-window-list@cinnamon.org in 57 ms
Cjs-Message: 17:51:13.812: JS LOG: [LookingGlass/info] Adding XAppStatusIcon: nm-applet (:1.59/org/x/StatusIcon/Icon)
Cjs-Message: 17:51:13.829: JS LOG: [LookingGlass/info] Adding XAppStatusIcon: mintUpdate.py (:1.86/org/x/StatusIcon/Icon)
Cjs-Message: 17:51:13.890: JS LOG: [LookingGlass/info] Loaded applet sound@cinnamon.org in 111 ms
Cjs-Message: 17:51:13.892: JS LOG: [LookingGlass/info] Adding XAppStatusIcon: mintreport (:1.107/org/x/StatusIcon/Icon)
Cjs-Message: 17:51:13.894: JS LOG: [LookingGlass/info] Adding XAppStatusIcon: maestral (:1.55/org/x/StatusIcon/Icon)
Cjs-Message: 17:51:13.897: JS LOG: [LookingGlass/info] Hiding XAppStatusIcon (we have an applet): vlc
Cjs-Message: 17:51:14.059: JS LOG: [LookingGlass/info] Hiding XAppStatusIcon (we have an applet): nm-applet (:1.59/org/x/StatusIcon/Icon)
Cjs-Message: 17:51:14.075: JS LOG: [LookingGlass/info] Loaded applet network@cinnamon.org in 184 ms
Cjs-Message: 17:51:14.148: JS LOG: Unknown network device type, is 14
Cjs-Message: 17:51:14.378: JS LOG: [LookingGlass/info] Loaded applet menu@cinnamon.org in 303 ms
Cjs-Message: 17:51:14.379: JS LOG: [LookingGlass/info] AppletManager started in 1660 ms
Cjs-Message: 17:51:14.389: JS LOG: [LookingGlass/info] Cinnamon took 2049 ms to start
Cjs-Message: 17:51:15.311: JS LOG: [LookingGlass/info] Adding systray: gigolo (24x24px)
Cjs-Message: 17:51:15.313: JS LOG: [LookingGlass/info] Resized gigolo with normalized size (24x24px)
Do you see it there somewhere?

Dave
dhdurgee
Level 4
Level 4
Posts: 434
Joined: Thu Jul 02, 2009 7:56 pm

Re: cinnamon runaway memory problem

Post by dhdurgee »

Just thought I should follow up and let those following this thread know that I added the script I posted to my startup applications and now cinnamon is kept under control. I have seen no problems running this script, but of course your mileage may vary.

Dave
miragon
Level 1
Level 1
Posts: 16
Joined: Mon Apr 19, 2021 8:21 am

Re: cinnamon runaway memory problem

Post by miragon »

Simply to bump this, I have now run Dave's script in my startup as well for one week and have not run into this problem since then! Thanks @dhdurgee Dave for sharing, that really helped :)
dhdurgee
Level 4
Level 4
Posts: 434
Joined: Thu Jul 02, 2009 7:56 pm

Re: cinnamon runaway memory problem

Post by dhdurgee »

I just updated to 20.2 and the new release of Cinnamon. As someone already noted in this thread, there is now a setting to do what my script does. Unfortunately it appears to be designed for systems with much more memory than I have, as it sets a lower limit of 1024MB before it will restart Cinnamon. Guess I will need to keep running my script and I will suggest this lower limit be relaxed in the future.

Dave
dhdurgee
Level 4
Level 4
Posts: 434
Joined: Thu Jul 02, 2009 7:56 pm

Re: cinnamon runaway memory problem

Post by dhdurgee »

I have opened this issue about the problem:

https://github.com/linuxmint/cinnamon/issues/10287

As I noted in my last comment, I believe I have located the file that must be fixed. Once I have confirmation of this I will test it out.

Dave

PS: additional comments in the issue. Still waiting for responses. Suggestion was to use dconf-editor to modify setting.
dhdurgee
Level 4
Level 4
Posts: 434
Joined: Thu Jul 02, 2009 7:56 pm

Re: cinnamon runaway memory problem

Post by dhdurgee »

Still no further response on github cinnamon issue.

Decided to give their feature a try, so I used dconf-editor to set the value to 320, disabled my script in the startup list and restarted my system. All still looked good when I went to bed last night. Unfortunately I woke up to a surprise.

When I came to unlock the system this morning I was faced with a black screen saying something about a screensaver failure and the need to use Ctrl-Alt-F1, login and issue a command to unlock the keyboard. Interestingly enough the Ctrl-Alt-F1 session would not open either, the mouse cursor simply disappeared. Given this I tried Ctrl-Alt-F2 and was able to get the task done.

I have attached a zip file containing what I think to be the relevant logs. If I am reading this correctly the restart was triggered at 01:32:56 this morning, but cinnamon was not actually restarted until 07:47:36 when I unlocked the keyboard from terminal 2!

Exactly what happened is a mystery to me. I am now debating trying one more time with their feature or disabling it and going back to my script. I never had such a problem with my approach. Maybe this was a fluke, maybe their restart approach is flawed.

Dave
Attachments
restarts.zip
(18.92 KiB) Downloaded 23 times
dhdurgee
Level 4
Level 4
Posts: 434
Joined: Thu Jul 02, 2009 7:56 pm

Re: cinnamon runaway memory problem

Post by dhdurgee »

I am now going back to my script. Once again screensaver encountered a problem likely due to their memory-limit restart. Once again had to use Ctrl-Alt-F2 to login and issue "cinnamon-unlock-desktop" so that cinnamon would restart when switched back to GUI.

For anyone interested I have posted the logs here for this morning.

Dave
Attachments
restarts.zip
(19.08 KiB) Downloaded 23 times
User avatar
majpooper
Level 8
Level 8
Posts: 2084
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: cinnamon runaway memory problem

Post by majpooper »

dhdurgee wrote: Tue May 18, 2021 12:04 pm Adjust the RSS threshold and check time to suit your system.
THX for your script. I have only run into this issue occasionally but still would like to have a work for this.
Can you tell me how much RAM your RSS setting was based on? I have several systems running Cinnamon with a range of RAM from 4Gib to 16Gib. I plan to test your script but I want to figure out a way to determine the MAX_RSS setting
dhdurgee
Level 4
Level 4
Posts: 434
Joined: Thu Jul 02, 2009 7:56 pm

Re: cinnamon runaway memory problem

Post by dhdurgee »

majpooper wrote: Sun Aug 29, 2021 11:12 am
dhdurgee wrote: Tue May 18, 2021 12:04 pm Adjust the RSS threshold and check time to suit your system.
THX for your script. I have only run into this issue occasionally but still would like to have a work for this.
Can you tell me how much RAM your RSS setting was based on? I have several systems running Cinnamon with a range of RAM from 4Gib to 16Gib. I plan to test your script but I want to figure out a way to determine the MAX_RSS setting
I have 8Gib here. The way I cam up with my figure is to open the System Monitor immediately after a restart and see how much memory it shows cinnamon to be using at that point. I then based my MAX_RSS setting upon that figure as 4-5 times that number. This is with a pretty basic cinnamon desktop. Yours may be more involved and use more memory.

Dave
dhdurgee
Level 4
Level 4
Posts: 434
Joined: Thu Jul 02, 2009 7:56 pm

Re: cinnamon runaway memory problem

Post by dhdurgee »

I noted earlier in this thread that I had encountered a problem using the memory-limit feature in Cinnamon 5.0.5 encountering screen-saver crashes as per:

https://github.com/linuxmint/cinnamon-s ... issues/392

There is a patched stage.py file made available in that issue which corrects this problem, so I am now using the memory-limit feature successfully. The only difficulty I had is that the general settings GUI will not allow entering a value less than 1024 for the memory-limit. So I needed to install dconf-editor from the repository and use it to set it to 320 as appropriate for my system. The dconf tool supplied may also be used if you don't want to install the editor. You can access the value as:

Code: Select all

dhdurgee@z560:~/Downloads$ dconf read /org/cinnamon/launcher/memory-limit
320
dhdurgee@z560:~/Downloads$ 
So my recommendation would be for those using this script with a Cinnamon version supporting the memory-limit feature use it, possibly needing to install the patch as noted in the issue above.

For those with earlier versions I have attached an updated script that no longer needs the xdotool installed. I don't know if you will encounter the issue above or not, nor do I know if the patch included applies to earlier releases. Given this use this version at your own risk. The version using xdotool is not vulnerable to this issue because the hot key is intercepted by the screen-saver, which will delay the restart until the keyboard is unlocked. This might cause its own problems if there is some sort of memory runaway which the system is locked up, but it is unavoidable with the xdotool approach.
Attachments
cinnamon_monitor.zip
(503 Bytes) Downloaded 25 times
dhdurgee
Level 4
Level 4
Posts: 434
Joined: Thu Jul 02, 2009 7:56 pm

Re: cinnamon runaway memory problem

Post by dhdurgee »

I had found that I was seeing multiple restarts overnight while the system was running the cinnamon screen saver. After confirming with the developer that there was not a memory leak in the screen saver itself I started a process of determining which of the applets I was using were the cause of the problem.

It turned out that the source of the memory leak was the Multi-Core System Monitor (multicore-sys-monitor@ccadeptic23) which I have since replaced with another applet. I have commented to the author of this applet and only time will tell if this is corrected. I have been running Cinnamon without a restart now for over 38 hours and memory usage is only 128Mb here.

Dave
JosephM
Level 6
Level 6
Posts: 1458
Joined: Sun May 26, 2013 6:25 pm

Re: cinnamon runaway memory problem

Post by JosephM »

@dhdurgee sorry I didn't see your reply showing the list of applets earlier. As soon as I saw the system monitor applet I was going to ask you to try removing it but it seems you beat me to it. Have seen multiple people have issues with that. Whenever you run into issue like this, removing 3rd parties applets and testing is probably a good start. They are never as thoroughly tested as the built in ones (less users) and sometimes work fine for some people and not others. It can be the reason we don't include an applet like that by default. Because we know it has problems under certain conditions.

The screensaver shouldn't be activating a cinnamon restart even if it did have a leak. It runs in a process separate from cinnamon. So wouldn't be the cause of high memory usage by Cinnamon itself.
When I give opinions, they are my own. Not necessarily those of any other Linux Mint developer or the Linux Mint project as a whole.
dhdurgee
Level 4
Level 4
Posts: 434
Joined: Thu Jul 02, 2009 7:56 pm

Re: cinnamon runaway memory problem

Post by dhdurgee »

I am now running System Monitor (sysmonitor@orcus) which appears to be working well without any memory leaks. In some areas I like it better than the one I had to drop, but in others I would like to see it tweaked a bit. I have made a few comments, but have yet to receive a response.

I should have realized had I thought about it that a leak in the screen saver would not impact the cinnamon process itself, but as I was seeing an interaction with the screen saver and the restarts when I was using xdotool for that purpose I forgot about it being a separate process.

In any case my issues with runaway memory are now under control. Hopefully this thread will be useful to others still having a problem.

Dave
Locked

Return to “Cinnamon”