Discussion:
KDevelop using 100% of CPU all the time
Benjamin CAILLAT
2017-07-19 17:23:50 UTC
Permalink
Hello,

KDevelop (5.1.1) on my Ubuntu (14.04.5 64 bits) is using 100% of one of my
core all the time. The project I'm working on is pretty big so it takes a
bit of time to load / parse everything, which is understandable. However,
KDevelop keeps using all the CPU even when the parsing is done (no task
window in the bottom right corner). Even after several hours, it keeps
using 100% of the CPU.

After attaching strace, I can see that it apparently loops on a poll:
poll([{fd=33, events=POLLIN}, {fd=23, events=POLLIN}, {fd=36,
events=POLLIN}, {fd=55, events=POLLIN}, {fd=11, events=POLLIN}, {fd=28,
events=POLLIN}, {fd=7, events=POLLIN}], 7, 0) = 0 (Timeout)
poll([{fd=33, events=POLLIN}, {fd=23, events=POLLIN}, {fd=36,
events=POLLIN}, {fd=55, events=POLLIN}, {fd=11, events=POLLIN}, {fd=28,
events=POLLIN}, {fd=7, events=POLLIN}], 7, 0) = 0 (Timeout)
poll([{fd=33, events=POLLIN}, {fd=23, events=POLLIN}, {fd=36,
events=POLLIN}, {fd=55, events=POLLIN}, {fd=11, events=POLLIN}, {fd=28,
events=POLLIN}, {fd=7, events=POLLIN}], 7, 0) = 0 (Timeout)

Has anyone experienced the same issue / has an idea about how to fix that?

Thank you so much!

Ben
René J.V. Bertin
2017-07-20 08:35:30 UTC
Permalink
Post by Benjamin CAILLAT
Hello,
KDevelop (5.1.1) on my Ubuntu (14.04.5 64 bits) is using 100% of one of my
core all the time. The project I'm working on is pretty big so it takes a
Hi,

I've seen this kind of behaviour, but only on exit. Please attach a debugger and get a backtrace from the active thread to see where it's being busy.

R.
René J.V. Bertin
2017-07-20 20:36:54 UTC
Permalink
(gdb) bt
#0 sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
#1 0x00007f2d83b57018 in fuse_session_loop_mt () from /lib/x86_64-linux-gnu/libfuse.so.2
#2 0x00007f2d83b5bfc7 in fuse_loop_mt () from /lib/x86_64-linux-gnu/libfuse.so.2
#3 0x00007f2d83b5e985 in ?? () from /lib/x86_64-linux-gnu/libfuse.so.2
#4 0x00000000004024c1 in main ()
On what kind of filesystem is your project hosted? KDevelop sets up directory watchers for all directories in your project, and I wouldn't be very surprised if for FUSE-based filesystems that means running a polling loop. It does seem incongruous though that this would eat 100% CPU; I don't think KDevelop needs to know about changes in the project source tree with millisecond precision...

R.
René J.V. Bertin
2017-07-21 07:30:31 UTC
Permalink
Thanks again for the follow up, let me know if you have any idea why FUSE
is used!
No idea if you're not using any FUSE-mounted volumes at all. Are you certain it is indeed the FUSE thread that's burning CPU?

R
Benjamin CAILLAT
2017-07-24 18:25:00 UTC
Permalink
Hello!

I think I know what happens: I'm using the AppImage (kdevelop version 5 is
not available for Ubuntu 14.04) and it seems that the image is mounted with
FUSE.
Instead, I mounted the image with a loopback an started the App from there
and so far it seems to be working!

Thank you so much for your help!

Benjamin
Post by René J.V. Bertin
Thanks again for the follow up, let me know if you have any idea why FUSE
is used!
No idea if you're not using any FUSE-mounted volumes at all. Are you
certain it is indeed the FUSE thread that's burning CPU?
R
Aleix Pol
2017-08-10 12:48:21 UTC
Permalink
Post by Benjamin CAILLAT
Hello!
I think I know what happens: I'm using the AppImage (kdevelop version 5 is
not available for Ubuntu 14.04) and it seems that the image is mounted with
FUSE.
Instead, I mounted the image with a loopback an started the App from there
and so far it seems to be working!
Thank you so much for your help!
Benjamin
Post by René J.V. Bertin
Thanks again for the follow up, let me know if you have any idea why FUSE
is used!
No idea if you're not using any FUSE-mounted volumes at all. Are you
certain it is indeed the FUSE thread that's burning CPU?
R
Would it make sense to have this reported upstream?

https://github.com/AppImage/AppImageKit

Aleix

Milian Wolff
2017-07-25 22:22:41 UTC
Permalink
Post by Benjamin CAILLAT
Hello,
KDevelop (5.1.1) on my Ubuntu (14.04.5 64 bits) is using 100% of one of my
core all the time. The project I'm working on is pretty big so it takes a
bit of time to load / parse everything, which is understandable. However,
KDevelop keeps using all the CPU even when the parsing is done (no task
window in the bottom right corner). Even after several hours, it keeps
using 100% of the CPU.
poll([{fd=33, events=POLLIN}, {fd=23, events=POLLIN}, {fd=36,
events=POLLIN}, {fd=55, events=POLLIN}, {fd=11, events=POLLIN}, {fd=28,
events=POLLIN}, {fd=7, events=POLLIN}], 7, 0) = 0 (Timeout)
poll([{fd=33, events=POLLIN}, {fd=23, events=POLLIN}, {fd=36,
events=POLLIN}, {fd=55, events=POLLIN}, {fd=11, events=POLLIN}, {fd=28,
events=POLLIN}, {fd=7, events=POLLIN}], 7, 0) = 0 (Timeout)
poll([{fd=33, events=POLLIN}, {fd=23, events=POLLIN}, {fd=36,
events=POLLIN}, {fd=55, events=POLLIN}, {fd=11, events=POLLIN}, {fd=28,
events=POLLIN}, {fd=7, events=POLLIN}], 7, 0) = 0 (Timeout)
Has anyone experienced the same issue / has an idea about how to fix that?
Never seen this, please use a profiler like perf to figure out what is going
on here.

kdevelop
# wait for it to "settle"
perf record --call-graph dwarf --pid $(pidof kdevelop)
# after ~5s or so interrupt
^C

Then use hotspot of FlameGraph to analyze the data, or look at `perf report`
directly.

Bye
--
Milian Wolff
***@milianw.de
http://milianw.de
Loading...