Bug 367541 - High memory usage when adding PIM Events in Digital Clock Widget
Summary: High memory usage when adding PIM Events in Digital Clock Widget
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Digital Clock (show other bugs)
Version: 5.7.3
Platform: Neon Linux
: NOR grave
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 372043 377160 393269 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-08-19 01:24 UTC by John Salatas
Modified: 2018-04-20 08:38 UTC (History)
30 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
plasmashell memory usage after enabling PIM Events Plugin in DigitalClock widget (70.87 KB, image/png)
2016-08-19 01:25 UTC, John Salatas
Details
screenshot from task manager (24.04 KB, image/png)
2016-10-06 20:36 UTC, Łukasz Żarnowiecki
Details
Very quick rise of memory and CPU usage (136.06 KB, image/png)
2016-11-05 15:27 UTC, Benedikt Geißler
Details
Backtrace when I clicked on "next month" (18.60 KB, text/plain)
2016-11-06 00:58 UTC, Benedikt Geißler
Details
Output of plasmashell running in valgrind after clicking on the clock applet (263.09 KB, text/plain)
2016-11-17 22:49 UTC, Benedikt Geißler
Details
sample fix (486 bytes, patch)
2017-11-27 19:48 UTC, Dmitry Nezhevenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Salatas 2016-08-19 01:24:38 UTC
I'm using KDE Neon user edition with all updates installed (as of August, 18th). 
In DigitalClock widget settings, when enabling the PIM Events Plugin, the memory usage goes very high, consuming all the available RAM (see screenshot). 

If I restart plasma, the DigitalClock widget works without a problem.
I should also mention that I have two owncloud calendars (not sure if this is related). 

I'm marking this bug as a Crash, although there is no actual a crash. The system just becomes unusable. 

Reproducible: Always
Comment 1 John Salatas 2016-08-19 01:25:39 UTC
Created attachment 100673 [details]
plasmashell memory usage after enabling PIM Events Plugin in DigitalClock widget
Comment 2 John Salatas 2016-08-19 01:48:26 UTC
I also tried with a new user profile (just to make that it isn't something related to my profile's settings) and it still behaves the same way.
Comment 3 flyos 2016-09-03 23:05:43 UTC
I can confirm this bug on openSUSE Tumbleweed. Also with an Owncloud calendar (I disabled "sync only XX months" option in Akonadi so this is a large calendar, but the memory imprint --memory filled on a 8Go RAM system-- cannot be explained by this alone).

I also confirms that the system becomes unusable due to the memory being filled.

Maybe a memory leak somewhere?
Comment 4 John Salatas 2016-10-01 09:59:43 UTC
Just an update: it seems that it is fixed in KDE neon developer unstable (as of Octber 1, 1016)
Comment 5 Łukasz Żarnowiecki 2016-10-06 20:31:09 UTC
I have exactly the same problem in 5.8 from arch packages.  When switch few times from klipper, pa to digital clock, plasma crashes and after a moment it restarts itself and there is a huge memory leak.
Comment 6 Łukasz Żarnowiecki 2016-10-06 20:36:03 UTC
Created attachment 101456 [details]
screenshot from task manager
Comment 7 x 2016-11-03 22:12:33 UTC
*** Bug 372043 has been marked as a duplicate of this bug. ***
Comment 8 x 2016-11-03 22:14:55 UTC
5.8.2, Tumbleweed, three OC calendars with 90 day old events limits, crashes like a train.
Comment 9 flyos 2016-11-03 22:17:58 UTC
I was going to seize the occasion to ask around if time limit was activated (it's not for me), but given x's account, this is not what's triggering the bug.

Owncloud seems a common denominator though isn't it?
Comment 10 CnZhx 2016-11-04 22:06:51 UTC
It seems I have this problem as well. But I am using Google calendar ICSs.

However, the situation is a little different. At first, I could not tick on PIM Events Plugin because of the crash problem. Later, it worked. But I cannot remember from which version of Plasma but not too old because I started using openSUSE Tumbleweed several months ago. Now, after snapshot 20161102 update, when I click the clock in the bottom right of the taskbar to try to view the calendar, the Desktop stop responding and the indicator of disk IO keep shining meaning that something is reading disk, and `plasmashell` process eats all the memory. During this, the mouse hardly responses. So I have to hard power off my laptop. (I am newbie knowing very few tricks to continue in such circumstances.)

So it seems that the problem is not relevant to ownCloud.

Hopefully this info helps.
Comment 11 Benedikt Geißler 2016-11-05 15:26:49 UTC
Same here.

openSUSE Tumbleweed, Plasma 5.8.2, Frameworks 5.27.0, Qt 5.7.0, Kontact/KOrganizer 5.3.0.

I select some calendars in the PIM Events Plugin, click on "apply" and the CPU load as well as the memory usage rise quickly. The whole screen freezes so that I can not even switch to another terminal (Ctrl+Alt+F1) or stop the desktop environment with Ctrl+Alt+Del or Ctrl+Alt+Backspace. After a certain time plasmashell crashes (perhaps because of the OOM killer?) and when I restart plasmashell (e.g. via krunner which still works) the settings in the PIM Events Plugin are reset (i.e. no calendars are selected anymore).

In addition to that the font in the PIM Events Plugin tab is kind of blurred in comparison to the other tabs…
Comment 12 Benedikt Geißler 2016-11-05 15:27:38 UTC
Created attachment 102052 [details]
Very quick rise of memory and CPU usage
Comment 13 Benedikt Geißler 2016-11-06 00:57:09 UTC
I just noticed that the same things happen when I click on the "next month" button in the digital clock applet. Here is a backtrace:
Comment 14 Benedikt Geißler 2016-11-06 00:58:05 UTC
Created attachment 102060 [details]
Backtrace when I clicked on "next month"
Comment 15 Sebastian Kuhne 2016-11-10 06:30:40 UTC
I have a similar issue reported to openSUSE bugzilla already (https://bugzilla.opensuse.org/show_bug.cgi?id=1008797)

I am running openSUSE tumbleweed, Plasma 5.8.3, KDE Framework 5.27.0, QT 5.7.0.

Maybe my analysis helps in the finding of the issue:
- If I enable standard calendar applet with default settings, everything is ok.
- If I enable "PIM events Plugin" only in "Settings", the applet crashes and also plasmashell crahes.
- If I additionally enable in the settings "PIM events Plugin" a certain number of calendars synchronized with google calendar in PIM everything is fine again.

Again, I know this is not exactly the same behaviour as described in the original thread but maybe it helps to understand the issue.
Comment 16 Benedikt Geißler 2016-11-17 22:49:19 UTC
Created attachment 102285 [details]
Output of plasmashell running in valgrind after clicking on the clock applet
Comment 17 CnZhx 2016-11-19 23:26:49 UTC
In addition to Comment 15 <https://bugs.kde.org/show_bug.cgi?id=367541#c15> by  Sebastian Kuhne, I found that if I did NOT select tasklist/to-do list of my Google account within "Select Calendars" in "PIM Events Plugin" in "Digital Clock Settings" page, plasmashell would NOT consume high memory and NOT crash.

In the previous Comment 10, I did not notice this.

Could anyone check on this results to confirm whether this problem is only with the task list in Google calendar?

I am not sure if this "improvement" brought by the recent updated Plasma Framework 5.28 or not. I am using openSUSE Tumbleweed 20161118 with KDE Plasma 5.8.3.
Comment 18 Nikolaos Kakouros 2016-12-06 00:53:04 UTC
I have the same problem. If I enable the PIM plugin and select calendars that have todos inside them, then plasmashell consumes all memory. If I remove the calendars with the todos, it works just fine.
Comment 19 flyos 2016-12-07 05:54:58 UTC
I can confirm that the bug is triggered by the presence of TODOs. To test this, I created 2 test calendars, one with TODOs, the other one without any. Without any surprise, only the former is triggering the bug.
Comment 20 John Salatas 2016-12-17 02:37:20 UTC
Just a quick update: in KDE neon user after upgrading to applications 16.12 (as of December 16), it seems that it can handle owncloud calendars with any memory leak given that there are no tasks in that calendar. If you try to add an owncloud calendar containing tasks, it still has the memory leak.
Comment 21 CnZhx 2017-02-04 10:28:54 UTC
This seems fixed in KDE Frameworks 5.30.0 or KDE Plasma 5.9.0. I cannot tell which of them exactly because I updated to them both at the same time.
Comment 22 flyos 2017-02-04 10:32:29 UTC
Not for me... :(

Just did the test (openSUSE Tumbleweed, Plasma 5.9, KF5 5.30), the memory leak is still there.
Comment 23 CnZhx 2017-02-04 11:12:32 UTC
(In reply to flyos from comment #22)
> Not for me... :(
> 
> Just did the test (openSUSE Tumbleweed, Plasma 5.9, KF5 5.30), the memory
> leak is still there.

Yes, you're right. It's not. I should've tried it more than once.

I'm using (openSUSE Tumbleweed, Plasma 5.9, KF5 5.30) as well. Have no idea why did the first try work.
Comment 24 court 2017-02-08 06:15:27 UTC
I have a Nextcloud server syncing 2 calendars. Crashes plasmashell like no tomorrow on Fedora 24. I also found out something peculiar. My machines that presented this issue previously had plasmashell 5.7.x installed and upgraded to 5.8.x, and it wasn't until I believe 5.8.5 that this arose. Machine 1 is F24 with upgrade from plasma 5.7 to 5.8, other machine was F24 with 5.7, then upgraded to F25 with 5.8. I did a clean install of F25 which had no prior trace of version 5.7 and the issue is gone
Comment 25 CnZhx 2017-02-08 10:11:29 UTC
(In reply to court from comment #24)
> ... and the issue is gone

Hi there, have you tried to deselect then enable the to-do list again? 

I tried on newly installed openSUSE Tumbleweed. It works first but causes the same problem as before if I disable the to-do list and enable it again, and another round fails as well. 

It looks like the same situation as I mentioned in Comment 21 and Comment 23, which happened on a system upgrade from previous versions.
Comment 26 court 2017-02-09 07:29:06 UTC
(In reply to CnZhx from comment #25)
> (In reply to court from comment #24)
> > ... and the issue is gone
> 
> Hi there, have you tried to deselect then enable the to-do list again? 
> 

Hey CnZhx, I looked at my PIM plugin and for me both my To-Do and my regular calendar are lumped together into one. What is also interesting is on my desktop which is Fedora 24 and was affected by this stopped presenting this issue which is interesting. I don't recall getting any updates pertaining to the clock widget
Comment 27 CnZhx 2017-02-09 10:58:15 UTC
(In reply to court from comment #26)
> (In reply to CnZhx from comment #25)
> > (In reply to court from comment #24)
> > > ... and the issue is gone
> > 
> > Hi there, have you tried to deselect then enable the to-do list again? 
> > 
> 
> Hey CnZhx, I looked at my PIM plugin and for me both my To-Do and my regular
> calendar are lumped together into one.
So, maybe this affects only a stand alone to-do list now.
Comment 28 flyos 2017-02-09 11:18:53 UTC
Nope, I don't have a stand-alone TODO list (it's merged into my agenda) and I'm affected using 5.9.0.
Comment 29 kafei 2017-02-28 01:56:28 UTC
This bug is still present with Plasma 5.9.2 and KF5 5.31. Same as what everyone else here described: after adding a TODO to my personal calendar, I tried enabling the "PIM Events plugin" in the Digital Clock widget. When I hit "apply", plasmashell used up all of my RAM and began swapping out to disk. Killing plasmashell was the only solution.
Comment 30 Haley S. 2017-07-17 17:28:20 UTC
I can confirm the last report with version 17.04.3.
Comment 31 Matt 2017-07-30 15:06:07 UTC
I am seeing the same issue on Fedora 26. I think a recent update just rolled it out and it renders my calendar (through the digital clock widget) useless because every time I try to use it my system hangs.
Comment 32 Mikhail Skorzhinskii 2017-08-23 10:06:47 UTC
Actually bug reproduces only when you have TODO items with one empty date. I.e. item without "End time" or "Start time". If there are no such items, issue do not reproducing.

OpenSUSE Tumbleweed, Plasma 5.10.4.
Comment 33 boospy 2017-09-08 16:02:11 UTC
I can reproduce here on KDE-Neon 5.10.5. Have some Nexcloud/Onwnloud Calendars. It crashes only when you use a date in the Todo list. 

It is a long time ago that the bug starts, and it is still unconfirmed... please fix it. 

Very thanks.
Comment 34 Gery 2017-09-21 12:05:11 UTC
Same problem here with a Nextcloud calendar containing both tasks and events. Seems to be related to some specific tasks as stated in comment #32, as only some specific calendar folders are triggering the problem.
Comment 35 Stefano 2017-09-22 10:10:04 UTC
I can confirm comments #32 and #33. I noted the same behavior with todo items with start or end date.
I't a very nasty bug, because it can take down all the system.
Comment 36 CnZhx 2017-09-25 11:16:24 UTC
I also tried the situation suggested in comment #32 and comment #33. And I found that if both "Start time" and "End time" were set for an entry, it's no problem to add the to-do list to the widget. However, after some time, maybe when the date passes the "Start time", the "Start time" is removed from that entry. After this, if the calendar widget is clicked to elevate, `plasmashell` will consume all the memory then crash.
Comment 37 Daniel 2017-09-28 06:51:58 UTC
I have the same problem. And I noticed today that it seems Google merged tasks to the calendar with events - just like it is in Nextcloud. Now I can't use/see neither Nextcloud nor Google tasks or events :(
Comment 38 Daniel 2017-10-02 11:43:07 UTC
I was mistaken about Google - they didn't change anything. Sorry.
Comment 39 Till Schäfer 2017-10-11 17:09:59 UTC
still reproducible in plasma 5.11, qt 5.9.2, frameworks 5.38, and kdepim 17.08.1 (on Gentoo)
Comment 40 Stefano 2017-10-11 17:57:50 UTC
Is anyone working on this? It's more than a year old, with lots of user comments confirming it, but the status is still "unconfirmed".
Comment 41 Till Schäfer 2017-10-11 18:33:40 UTC
confirmed has no special meaning here. It does not mean that anybody is working on it.
Comment 42 Christoph Feck 2017-10-25 20:20:07 UTC
Then don't change the status. We still need a developer who understands both Plasma as well as KDEPIM code, because the bug is anywhere between the two.

We can change the status to CONFIRMED once we know where the bug is exactly. Until then, hope that someone who can reproduce provides useful valgrind logs, or does other investigations.
Comment 43 Dmitry Nezhevenko 2017-11-27 19:48:16 UTC
Created attachment 109086 [details]
sample fix

I'm attaching small patch that fixes this issue for me (sorry it's based on kdepim-addons 17.08 from debian experimental).

I've found that EventDataVisitor::insertResult is sometimes called with invalid startDateTime. And due to this insertResult will stuck forever.

Another possible fix is to implement check in BaseEventDataVisitor::isInRange just to make sure that both start and end dates are valid.

Hope it's enough for devs to understand cause of this issue.
Comment 44 Alexander Mentyu 2017-12-11 08:10:18 UTC
Possibly related - https://bugs.kde.org/show_bug.cgi?id=377160
Comment 45 skycoder42.de 2017-12-16 20:31:51 UTC
Any updates on this. As of today the problem still exists with Plasma 5.11.4 and kdepim-addons 17.08.3
Comment 46 Christoph Feck 2017-12-20 19:05:39 UTC
Dmitry, thanks for the patch! Could you please submit it via https://phabricator.kde.org/differential/diff/create/ and add both Plasma as well as KDEPIM as reviewers?
Comment 47 skycoder42.de 2018-01-03 10:34:56 UTC
Possible duplicate: https://bugs.kde.org/show_bug.cgi?id=377160
Comment 48 Kai Uwe Broulik 2018-01-11 09:54:09 UTC
*** Bug 377160 has been marked as a duplicate of this bug. ***
Comment 49 Kai Uwe Broulik 2018-01-11 12:03:44 UTC
Git commit af23ae70e47d9d7e93c013d107397999df0ecb56 by Kai Uwe Broulik.
Committed on 11/01/2018 at 12:02.
Pushed by broulik into branch 'master'.

[EventDataVisitor] Place events without start date at end date

This avoids an infinite loop.
Thanks Dmitry Nezhevenko for investigating.

CHANGELOG: Fixed an issue that would cause Plasma to freeze when there was an agenda item with no start date in the calendar

Differential Revision: https://phabricator.kde.org/D9811

M  +7    -0    plugins/plasma/pimeventsplugin/eventdatavisitor.cpp

https://commits.kde.org/kdepim-addons/af23ae70e47d9d7e93c013d107397999df0ecb56
Comment 50 Stefano 2018-03-09 09:40:51 UTC
Is it already merged? Because I still have this issue.

KDE Plasma: 5.12.2
Frameworks: 5.43.0
QT: 5.10.0

I'm using Neon and my kdepim package is stuck at version: 4:16.08.3-0neon+16.04+build22
Comment 51 flyos 2018-03-09 09:53:41 UTC
This fix is for kdepim-addons, which seems to be part of the KDE Applications, so if it's merged in master, it probably won't land in KDE Neon User Edition before next April (for the 18.04 release).
Comment 52 flyos 2018-03-09 09:53:51 UTC
This fix is for kdepim-addons, which seems to be part of the KDE Applications, so if it's merged in master, it probably won't land in KDE Neon User Edition before next April (for the 18.04 release).
Comment 53 Stefano 2018-03-09 10:37:34 UTC
(In reply to flyos from comment #51)
> This fix is for kdepim-addons, which seems to be part of the KDE
> Applications, so if it's merged in master, it probably won't land in KDE
> Neon User Edition before next April (for the 18.04 release).

Thanks for clarifying this. I expected KDE Applications to be updated ad soon as possible, like plasma and framework. Instead they follow the Ubuntu LTS release.
Comment 54 flyos 2018-03-09 10:50:49 UTC
Not really, there are 3 releases a year in April, August and December. Only the release in April is "synchronised" with Ubuntu and I doubt it's by design.

More details here: https://community.kde.org/Schedules
Comment 55 Kai Uwe Broulik 2018-04-20 08:38:49 UTC
*** Bug 393269 has been marked as a duplicate of this bug. ***