Bug 459288 - Uses lots of CPU power
Summary: Uses lots of CPU power
Status: ASSIGNED
Alias: None
Product: plasma-activities
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.97.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Ivan Čukić
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-17 15:47 UTC by kdebuac.rhn
Modified: 2022-09-18 12:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kdebuac.rhn 2022-09-17 15:47:42 UTC
SUMMARY

kactivitiesd and/or plasmashell will go crazy when switching activities and consume 100% of a core for a few seconds to (in a congested system) a few minutes, making plasma stop responding to input.

It seems related to the kactivity database at .local/share/kactivitymanagerd/resources/database.

According to perf, the culprit is a lot of reads via __libc_pread64 (46.75% + 34.12%), strace confirms.

The database file is 241M in size

STEPS TO REPRODUCE
1. Switch between activities by clicking on the panel widget
2. Switch again, quickly

OBSERVED RESULT
About 20% of the time, plasmashell freezes for a while, taking 100% CPU
Less than 20% of the time, kactivitymanagerd takes 100% CPU for some seconds

EXPECTED RESULT
Plasmashell never freezes.
Activities-related processing never utilizes 100% CPU for more than a fraction of a second (I know activities are more than that, but I use them as virtual desktops, which should be light).

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 36
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
Kernel Version: 5.19.4-200.fc36.x86_64 (64-bit)
Graphics Platform: X11
Processors: 2 × Unknown Type, 2 × Intel® Core™ i5-3380M CPU @ 2.90GHz
Memory: 11.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 4000
Comment 1 Ivan Čukić 2022-09-18 10:55:56 UTC
Hi, can you list the sizes of the files in database directory? How big is the wal file?

We've had no problems with sqlite for years, and the latest versions just went berserk...
Comment 2 kdebuac.rhn 2022-09-18 12:53:10 UTC
-rw-r--r--. 1 foo foo 225M Aug 16 13:01 database
-rw-r--r--. 1 foo foo  32K Aug 16 13:29 database-shm
-rw-r--r--. 1 foo foo 6.6M Aug 16 13:29 database-wal

I've had hangs while switching activities for years, although 100% CPU usage joined the symptoms only the last year or two.