Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak on lxpanel #4263

Closed
rin67630 opened this issue Apr 7, 2021 · 9 comments
Closed

Memory leak on lxpanel #4263

rin67630 opened this issue Apr 7, 2021 · 9 comments

Comments

@rin67630
Copy link

rin67630 commented Apr 7, 2021

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+ crash on 4.1.15 #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?

@lionello
Copy link

I'm running into this too. @rin67630 what do you mean with "depress the bluetooth button"?

@JanDiederich
Copy link

JanDiederich commented Aug 8, 2023

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.

@rin67630
Copy link
Author

rin67630 commented Oct 4, 2023

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 temporarily the memory leak.

@galmok
Copy link

galmok commented Jun 8, 2024

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.

@galmok
Copy link

galmok commented Jul 23, 2024

I upgraded my RPi OS to the latest (there is a guide somewhere) and now the lxpanel is ok (no more huge memory consumption).

@Master-Code-Programmer
Copy link

I upgraded my RPi OS to the latest (there is a guide somewhere) and now the lxpanel is ok (no more huge memory consumption).

Can confirm. I completely reinstalled Raspberry PI OS in its latest version, and the bug is gone.

@pelwell pelwell closed this as completed Jul 23, 2024
@rin67630
Copy link
Author

rin67630 commented Jul 24, 2024

The last version?
Do you mean Bookworm with Wayland?
That does not work on the weakest Raspberries, those freqently used remotely.
I don't consider it solved.

@galmok
Copy link

galmok commented Jul 24, 2024

Just checked the version I am running and it says "12 (bookworm)" in /etc/os-release.

@rin67630
Copy link
Author

rin67630 commented Jul 28, 2024

Yes, I meant Bookworm with Wayland, which has a completely different windowing system.
So the bug remains for the weakest systems (with the least memory), those running headless and X-11 remote, supported by VNC.
Please reopen that issue.
P.S. the memory leak is very plausibly in the bluetooth module of LXpanel.
With Bluetooth permanently disabled, there is no memory leak.
Using Bluetooth only from time to time is OK as well.
Just don't leave it on for days...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants