Planner: High CPU Usage

Created on 20 Oct 2020  路  16Comments  路  Source: alainm23/planner

Description:

CPU usage reports 100% or higher using top and 2.5% using gotop.

To Reproduce:

Just opening Planner and leaving it idle in the foreground. When it's on the background, it goes away.

Expected behavior:

It shouldn't throttle my CPU. I have a very old laptop though I can run heavy things (e.g. Android Studio) but my fan stays calm when it's just idle and not building anything. While for Planner, the fans run their fastest possible speed (hence a lot of noise) to cool down the CPU...

This is weird, because Planner, unlike the heavy Android Studio, has to be a very lightweight application, all while performing all the scheduling and background tasks. Android Studio, on the other hand, still does a bunch of periodic background checks, file refreshes, auto-saving and much more when idle, though it feels as if it's "not even there", with almost zero impact on the performance.

I hope there's a way to fix this. I suspect it's related to the background checks and database operations, but you know best, and I hope you find a way to fix it.

Screenshots:

On top:
image

On gotop:
image

System details:

  • OS & DE: Ubuntu 20.04; GNOME.
  • Version 2.5.4 (flatpak).
  • CPU: Intel Core i5 Gen 2.
Bug

All 16 comments

Less noticeably for me on my system (newer computer), but I'm affected to. At my 5 years old work laptop it consumes closer to 25% of one core and is more noticeable.

Screenshot from 2020-10-21 11-45-17

If I strace the process this is what's going on ... not sure if that's relevant.

Screenshot from 2020-10-21 11-46-24

The above system is running Ubuntu 20.04, my work computer is running 18.04. Both using the flatpak.

Possible related to #361

I investigated a little deeper yesterday and the file handle in question is an unix socket that talks with dbus, if that helps. This can of course be something unrelated. The POLLING event appears several times/second.

Yeah, it appears as if some infinite loop (intentional or unintentional) runs at its highest possible speed which leads to this high CPU usage... I don't know the code, but I wonder if we could put that repetitive task in a timer instead (if my hypothesis is true)

I too have the same behaviour. The CPU usage for Planner touches easily around 20% to 30%.

Happens to me too. Ranges between 35% and 50%.

Same problem on my computer using Manjaro with KDE. Minimizing the window reduces the CPU usage, but keeping it open and using another window cranks up the CPU.

Small note: I've recently tried elementaryOS through a USB, and I noticed this issue with few system apps like the App Center, which does basically the same thing when idle.

About 20% for me

/.../ I noticed this issue with few system apps like the App Center, which does basically the same thing when idle.

I have considered it to be a bug in an Elementary framework, the question is which one so we can submit a bug.

Regarding the elementary App Center, they've apparently fixed this problem recently: https://github.com/elementary/appcenter/issues/1160.

This has been fixed in June and I tried the system myself in October. I might have been using an older version of App Center packaged with the system, as I didn't let it upgrade itself (it was booted directly from USB, just to try it).

Looking at the solution they found, it's not related to any frameworks or anything like that, it's just a screenshot cleaning code that was never stopping.

In the case of Planner, I guess it has something to do with the database operations or the auto syncing with Todoist.

I am having the same issue. Flatpak planner v2.5.7 on ubuntu 18.04
Let me know if you need any logs.

Having over 8% of cpu usage

image

Hi again! I just switched to elementaryOS (after my HDD died) and this issue is still there (in the Debian version, same as Flatpak).

I am experiencing this issue too, built from source - Ubuntu 18.04. Also I am seeing non-stop polling and retries (snippet from strace):

recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 11) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 13) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 13) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 14) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 13) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 12) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 12) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 12) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 13) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 13) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 13) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 13) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 13) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 14) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 13) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 13) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 14) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 13) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=20, events=POLLIN}, {fd=21, events=POLLIN}], 6, 14) = 0 (Timeout) recvmsg(11, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)

Yeah, I suspect that's some sort of database issue or syncing code that's problematic there. That's my biggest complaint about Planner's impact on performance - if I leave the app window open. Of course the only workaround is to close it when you're done, and as closing it does not actually quit it, it restores its state quickly.

@Skaldebane thank you for the workaround! I was always just minimizing to ensure I could use the global hot key to add a task from anywhere, but as you mentioned the app is still running and the global hot key still works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zedtux picture zedtux  路  4Comments

Brin-o picture Brin-o  路  5Comments

naaando picture naaando  路  7Comments

joe733 picture joe733  路  7Comments

ie900 picture ie900  路  5Comments