Memory leak on lxpanel
Describe the bug
The panel of the current version (and previous ones) of Raspberry Pi suffers from a memory leak.
The system runs further but becomes inoperable remotely.
To reproduce
Just let Raspbery Pi run for a long time, after a few months (almost) no menu function will be callable.
The system runs further but becomes inoperable, can't even call Terminal
Expected behaviour Call e.g terminal
Actual behaviour Got out of memory message "Failed to fork (Cannot allocate memory)" cf also https://www.raspberrypi.org/forums/viewtopic.php?t=267015
System Cannot load any new task on that system ( working else normally, for what is loaded) especiallly not Terminal to call reports.
-
Which model of Raspberry Pi? e.g. Pi3B+, PiZeroW All models
-
Which OS and version (
cat /etc/rpi-issue)? e.g. Distributor ID: Raspbian Description: Raspbian GNU/Linux 9.13 (stretch) Release: 9.13 Codename: stretch but also the current version with updates upgrades from 6 weeks ago. -
Which firmware version (
vcgencmd version)? e.g. version 0e6daa5106dd4164474616408e0dc24f997ffcf3 (clean) (release) (start) -
Which kernel version (
uname -a)? e.g 4.19.66-v7+ #1253
Logs cannot call terminal, hence no log
Additional context N.B. All systems are remote, running VNC with team connection.
I did find a workaround: depress the bluetooth button on the panel.
This reloads the panel and everything gets cleared! So could this help to find the culprit?
I'm running into this too. @rin67630 what do you mean with "depress the bluetooth button"?
I get this with a self-written software after a few hours. After 10 hours the 4 GiB of my Raspberry Pi 4 are nearly full! I suspected at first my own software, but it uses barely any memory, and if it has a leak it's tiny. lxpanel memory usage explodes. Restarting lxpanel seems to fix everything.
This should fix it longer, by automating it:
Open Terminal
Enter crontab -e.
Add this entry, to restart the lxpanel every full hour:
0 * * * * /bin/bash -l -c "export DISPLAY=:0 && lxpanelctl restart"
The DISPLAY=:0 should be equal to the DISPLAY setting in your users env output.
As addon in the panel I have only the listing of the open programs.
I'm running into this too. @rin67630 what do you mean with "depress the bluetooth button"? Sorry for the late answer. In the panel there is a Bluetooth field. If you click on it it fixes the memory leak.
Restarting lxpanel is the only solution right now, but due to security, it cannot be done with "export DISPLAY=:0 && lxpanelctl restart":
root@raspberrypi:~# DISPLAY=:0 lxpanelctl restart
Invalid MIT-MAGIC-COOKIE-1 keyCant connect to display: :0
We need a solution to this problem. 1-2 weeks of of idle time and lxpanel consumes all memory and crashes the OS.