On my Raspbian 2018-11-13 installation with all updates (sudo apt-get update
and sudo apt-get upgrade
), I see the CPU graph in the task bar (top right corner) at constant 25%.
I opened a terminal and used top
to have a look at the process list and CPU consumption. It tells me that lxpanel
is at 100% CPU, which AFAIK matches the 25% of the graph, since my RPi3 has 4 cores and top
uses 100% for one core, whereas the graph will be filled 25% only (100% of 400%).
As you can see in the screenshot, the load average is 1.00, which is likely due to lxpanel, since that has already 55 minutes of CPU time (of 56 minutes uptime) and at the time of the screenshot used 99.3% as well.
There are already a lot of Google results for this issue, dating back until 2011. It seems to apply to various operating systems, including Debian, Ubuntu and Raspberry OS (formerly Raspbian).
I've also seen a similar question here on this site, but it lacks detailed information, blames lxterminal
and the answer is not helpful.
I'd like to know:
- what may cause this issue?
- how to mitigate this issue?
- how to provide useful information for lxpanel developers? (e.g. call stacks during the 100% CPU usage)
I've not yet figured out on how to reproduce this issue. It seems that it's related to working with lxpanel. IMHO I saw it happen after pairing Bluetooth, connecting to WLAN and operating with USB Sticks. However, I can't provide a sequence of steps yet. Every time I try to reproduce it, it fools me.
However, I hope that this problem can be reproduced and solved now, since it happens on a standardized platform, compared to the various different installations I googled about.
Things I've tried:
- rebooting. This usually helps for a while until the issue reappears. Obviously, rebooting every now and then is not an acceptable solution.
- killing
lxpanel
and starting it again. This helps, but the panel has a different look and feel. - Github Linux Issue 2518, but it was closed as not reproducible. They talk much about power issues. I am using a 6 Amp lab power supply.
- a topic in the RPi forum where they suggest to disable the CPU panel. Actually I don't want to disable it. It's useful, since I am developing software and I want to see whether there could be a performance issue in my code (like I spotted the 25% of lxpanel).
- a short and not helpful post in LXDE forums from 2011
- Debian bug 669242, which should be fixed since 2013
- a forum post on LXLE running from a Live DVD (2014).
- an Ubuntu Forum post suggesting to switch the OS completely
As you can see, all findings seem to miss a root cause analysis. If I can't solve it, I'd like to participate in such a root cause analysis, since it happens quite often on my machine.
Things that might be special in my configuration, although I can't see a relationship to lxpanel:
- I have SPI enabled
- I have the internal sound card disabled via
/boot/config.txt
- I have set the USB sound card as the default sound card in
/usr/share/alsa/alsa.conf
Update 2019-03-28
I had the same situation again and I found gcore <pid>
, which seems to generate a core dump of the process. Now I have 5 files of ~80 MB in size.
I also used strace -f -o <file> -p <pid>
and I have a ~20 MB file with repeating calls.
lxpanel
is so because it is part of LXDE. The current default Raspbian/RpiOS desktop environment is a fork of LXDE.