Bug 250884 - Ktorrent causes high Xorg CPU usage
Summary: Ktorrent causes high Xorg CPU usage
Status: RESOLVED WORKSFORME
Alias: None
Product: Oxygen
Classification: Plasma
Component: general (other bugs)
Version First Reported In: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-11 15:47 UTC by Vadym Krevs
Modified: 2018-11-06 16:12 UTC (History)
3 users (show)

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


Attachments
First 900000 bytes of the compressed attachment (878.91 KB, application/octet-stream)
2011-11-21 07:10 UTC, Vadym Krevs
Details
Final 747249 bytes of the attachment (729.74 KB, application/octet-stream)
2011-11-21 07:10 UTC, Vadym Krevs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vadym Krevs 2010-09-11 15:47:39 UTC
Version:           unspecified (using KDE 4.5.1) 
OS:                Linux

openSUSE 11.3/x86_64, KDE 4.5.1 from openSUSE build service, ktorrent 4.0.3

Start top in konsole. Observe xorg consume no more than 3% of CPU. Start Ktorrent and resume a torrent. Observe Xorg process suddenly take up to 50% of CPU. Minimize ktorrent. Xorg's cpu usage drops back to 3%. Restore Ktorrent window - Xorg process is back at 50% CPU. Desktop effects are off. 
ATI Radeon HD 3650 + catalyst 10.8. Other kDE apps do not cause such CPU usage in XOrg.

Reproducible: Always




OS: Linux (x86_64) release 2.6.34.2-0.1-desktop
Compiler: gcc
Comment 1 Joris Guisson 2010-09-11 19:29:47 UTC
What is the GUI update interval set to, and how many torrents do you have ?
Comment 2 Vadym Krevs 2010-09-11 22:08:26 UTC
Never even knew there was a "GUI update interval". It is set to 1000 ms. Just 1 torrent.
Comment 3 Joris Guisson 2010-09-12 10:29:45 UTC
Then I don't see what could be causing CPU usage to hit 50 % for Xorg. It's not like we are doing something different then other KDE apps. The GUI part is just a bunch of Qt widgets, nothing special at all.

What happens if you try a different widget style ?
Comment 4 Vadym Krevs 2010-09-12 15:45:46 UTC
Switching from Oxygen to Plastique immediately drops Xorg's CPU usage to under 2%. Looks like the "default" style shipped with openSUSE (and KDE 4.5.x for that matter) does like what ktorrent does to it.
Comment 5 Joris Guisson 2010-09-13 20:17:34 UTC
I'm reassigning to the oxygen people, they should be able to figure out what is causing it.
Comment 6 Hugo Pereira Da Costa 2010-09-15 01:04:31 UTC
Hello.
Try disable "text editor animations" from oxygen-settings (type oxygen-settings in either konsole or krunner).

This option is likely to cause the issue (because of the frequent update of the statusbar). 

If yes I'll disable the animation (by default) for kde4.5.2, cause it causes too many problems, and will close the bug report.
Comment 7 Hugo Pereira Da Costa 2010-09-15 01:05:09 UTC
oops 
sorry.
Not the "text editor transitions" but rather the "label transitions"
Comment 8 Hugo Pereira Da Costa 2010-09-15 01:08:42 UTC
PS: there is a chance that my latest commits to trunk and backport to oxygen 4.5 also improves the situation. I'll double check on my side.
Comment 9 Hugo Pereira Da Costa 2010-09-15 02:29:41 UTC
PS: for the record (which does not invalidate the suggestions above, not the fact that I'm willing to help fixing it), I cannot reproduce the issue here.
Running ktorrent with oxygen, and one active download, my X stays between 2 to 4% when my desktop is idle and starts jumping around (of course), as soon as I move some window, create a new one, etc. 
e.g. nothing unexpected. 

This is true whether using oxygen from trunk or from the current 4.5 branch, and (maybe more important), whether or not I disable recent commits concerning pixmap cache usage limitations (introduced to fix a separate issue with nvidia cards). 

My graphics card is intel (i915).
Maybe another driver-dependent issue (argh)

My (somewhat frustrated) feeling is that the situation with video cards drivers these days is quite messed-up, and oxygen just fancy enough to trigger all kind of issues with one or the other.

Keep me posted on the test above (and if just disabling the label animations doesn't help, try disable them one by one, to see if one in particular creates the issue).

Thanks for your patience,

Hugo
Comment 10 Hugo Pereira Da Costa 2010-09-15 02:37:30 UTC
PS: you use fancy kwin effects ? 
Like, e.g. blur ? 
Does the thing still remain if you turn them off ? 
I'm asking because oxygen animations triggers quite more window 'updates' than other styles, due to animations, (especially in ktorrent statusbar), and if for some reason something else make these updates more CPU consuming, that will be more visible with oxygen than any other style ...
Comment 11 Vadym Krevs 2010-09-15 08:29:12 UTC
(In reply to comment #7)
> oops 
> sorry.
> Not the "text editor transitions" but rather the "label transitions"

Disabling text and/or label animations had no effect Xorg's CPU usage caused by an open Ktorrent with a single active torrent.
Comment 12 Vadym Krevs 2010-09-15 08:29:58 UTC
(In reply to comment #9)
> PS: for the record (which does not invalidate the suggestions above, not the
> fact that I'm willing to help fixing it), I cannot reproduce the issue here.
> Running ktorrent with oxygen, and one active download, my X stays between 2 to
> 4% when my desktop is idle and starts jumping around (of course), as soon as I
> move some window, create a new one, etc. 
> e.g. nothing unexpected. 
> 
> This is true whether using oxygen from trunk or from the current 4.5 branch,
> and (maybe more important), whether or not I disable recent commits concerning
> pixmap cache usage limitations (introduced to fix a separate issue with nvidia
> cards). 
> 
> My graphics card is intel (i915).
> Maybe another driver-dependent issue (argh)
> 
> My (somewhat frustrated) feeling is that the situation with video cards drivers
> these days is quite messed-up, and oxygen just fancy enough to trigger all kind
> of issues with one or the other.
> 
> Keep me posted on the test above (and if just disabling the label animations
> doesn't help, try disable them one by one, to see if one in particular creates
> the issue).
> 
> Thanks for your patience,
> 
> Hugo

My system has an ATI Radeon HD 3650 card with the latest ATI Catalyst 10.8 driver.
Comment 13 Vadym Krevs 2010-09-15 08:31:31 UTC
(In reply to comment #10)
> PS: you use fancy kwin effects ? 
> Like, e.g. blur ? 
> Does the thing still remain if you turn them off ? 
> I'm asking because oxygen animations triggers quite more window 'updates' than
> other styles, due to animations, (especially in ktorrent statusbar), and if for
> some reason something else make these updates more CPU consuming, that will be
> more visible with oxygen than any other style ...


KDE desktop effects are off.
Comment 14 Hugo Pereira Da Costa 2010-09-15 16:16:19 UTC
@Vadim
What about disabling the other animations ? (but I have little hope).
Comment 15 Vadym Krevs 2010-09-15 22:10:20 UTC
Turning off all animations halves Xorg's CPU usage (with a torrent selected and the Peers tab displayed). If no torrent is selected, and hence none of the tabs below are active, then Xorg's CPU usage drops to 4-5%.
Comment 16 Hugo Pereira Da Costa 2010-09-16 06:42:42 UTC
@comment 15: to be honest, I'm quite clueless.
I still cannot reproduce (when selecting the 'peer' tab) ... 

Does it also happen when you select any other tab than the 'peer' one ? 
(notably I'd be interested to know if this is a case with any tab that has a "list", e.g. anything but not 'status')
Comment 17 Vadym Krevs 2010-09-16 09:18:48 UTC
Switching between tabs causes huge Xorg CPU% spikes - up to 80% ... Once a tab is selected, the following average is reported by top:
Tab                 Xorg CPU%
Queue Manager       15
Magnet              18
Status              20
Files               16
WebSeeds            18
Peers               40-55
Chunks              60
Tracker             19

Also, ktorrent itself reports ~17% CPU usage when Xorg's CPU usage is high.
Comment 18 Hugo Pereira Da Costa 2010-09-20 16:26:50 UTC
Thanks a lot for the detailed information, although so far I have not been able to make anything out of it :(
Comment 19 Vadym Krevs 2011-11-20 18:32:50 UTC
Same on the same hardware as in the original bug report with openSUSE 11.4, KDE 4.7.3, and latest AMD Catalyst video drivers.
Comment 20 Hugo Pereira Da Costa 2011-11-20 23:45:30 UTC
Could you try disable all oxygen animations and see if it improves things (it should), and if yes, by how much ? (should not be as good as with plastique, because oxygen is more complicated to paint)
Also, provided disabling animations helps, you could then try re-enable them one by one to see what the curlpit is.

Thx,

Hugo
Comment 21 Vadym Krevs 2011-11-21 07:10:09 UTC
Created attachment 65889 [details]
First 900000 bytes of the compressed attachment

(I used split -b 900000 in order to upload the attachment).
Comment 22 Vadym Krevs 2011-11-21 07:10:36 UTC
Created attachment 65890 [details]
Final 747249 bytes of the attachment
Comment 23 Vadym Krevs 2011-11-21 07:12:18 UTC
Will do that once I have some time, but in the meantime please find attached the callgrind profile of an idle ktorrent instance started from konsole with no torrents at all - which still causes very high Xorg CPU usage unless minimized.
Comment 24 Andrew Crouthamel 2018-11-06 15:06:34 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 25 Vadym Krevs 2018-11-06 16:06:04 UTC
The latest Ktorrent works fine.
Comment 26 Andrew Crouthamel 2018-11-06 16:12:27 UTC
Thanks for the update!