Memory leak somewhere in Raspberry Pi 3

Thread Starter

kwilke61

Joined Oct 17, 2016
4
Hi,
I am using a Raspberry Pi 3 to control solar cells and charge LiIon batteries. I have four processes each running in a different shell that pass messages to another controlling process. It runs four up to 8 weeks (sometimes less) and then all the memory is used. It looks to me like it is lxterminal that is somehow causing the problem. However, I installed rxvt and am using it instead, and am seeing the same problem. the processes lxpanel seems to be growing for no apparent reason.

Anyway, I need this hardware/software to run for up to five years without rebooting. So far, one month seems unusable.. Any Ideas?

The actual processes I created do not seem to be leaking, it seems that the OS or something it uses is leaking.

Thanks in advance,
Keith
 

dendad

Joined Feb 20, 2016
4,451
I don't know about the memory leak but if you want the RasPi to run for years it may be an idea to make the operating system Read Only. I have had a RasPi PABX trash the SD card with overuse. It was not power cycling.
You could use a USB stick for any data logging if that is needed. And there are a lot of on line cases of RasPi boards trashing the SD cards. Most replies blame switching off the power without shutting it down and that can cause problems too but writing too many times to the SD card is a big problem. Use a large card with the file system expanded to fill it and make sure it is a good high use card.
I hope you find the memory leak too.
 

Sensacell

Joined Jun 19, 2012
3,432
Very painful problem.
Can you make the system auto-reboot at a specific time?
Just have it reset itself once a week.

I know that's not what you wanted to hear, but it might solve the problem.
 

shteii01

Joined Feb 19, 2010
4,644
It sounds like software is not releasing the memory. It is likely that any sort of memory management was never implemented in the first place. You will have to investigate if the software you are using have any memory management features or you can see if you can find any additional software whose function is to manage memory and free up memory at regular intervals.
 

Thread Starter

kwilke61

Joined Oct 17, 2016
4
It sounds like software is not releasing the memory. It is likely that any sort of memory management was never implemented in the first place. You will have to investigate if the software you are using have any memory management features or you can see if you can find any additional software whose function is to manage memory and free up memory at regular intervals.
My software is not the problem. I use the GUI 'taskmanager' to look at the memory usage and my processes are not growing, only lxpannel is slowly growing.
 

Thread Starter

kwilke61

Joined Oct 17, 2016
4
Right now I am leaning towards just killing any lxpanel processes.
I may create a shell job that is run by cron that:
pidof lxpanel
kill -9 <processid>

This seems to return the memory.
Any downside to this?
 

pickel

Joined Sep 5, 2018
1
Hi,
Thanks for bringing this topic up. I have the same issue and i find
lxpanelctl restart
is a nicer way to regain memory, it is non disruptive and can be done without penalty. If you kill lxpanel you have to restart it again if you want to use it.
I will put that in our setup in a cron job myself.
 

Thread Starter

kwilke61

Joined Oct 17, 2016
4
Hi,
Thanks for bringing this topic up. I have the same issue and i find
lxpanelctl restart
is a nicer way to regain memory, it is non disruptive and can be done without penalty. If you kill lxpanel you have to restart it again if you want to use it.
I will put that in our setup in a cron job myself.
Your idea is much better than mine. I never knew there was a lxpanelctl command. I had a hard time even understanding what the problem was. Thanks
 
Top