Autoshutdown plugin memory leak

Hi all,

I have discovered a memory leak caused by the Automatic shutdown plugin.

If you install the Dashboard plugin, which allows you to view the raspberry pi RAM usage and you also install the Autoshutdown Plugin, you will notice that every time you refresh your browser, the pi RAM usage goes up by almost 10%, so after frequent remote logins you can crash the raspberry pi as it runs out of RAM.

I have the latest download of Octoprint and have disabled all other plugins, if I disable Autoshutdown, this memory leak does not occur.

I have notified the author of this plugin on GitHub but wanted to post it here for two reasons:

  1. my raspberry Pi would crash mid print and the printer would freeze with the heaters on and I could never figure out why - this has been reported by many other users and I believe this memory leak is the issue.

  2. I fear the the author of this plugin no longer maintains it as the posts on gitHub are old; I really love and would like to use this plugin and was hoping that someone would be interested in looking at the source code and maybe fixing the issue?

Any help would be appreciated.

p.s. to reproduce the issue, you should monitor the pi RAM use with the Dashboard plugin, otherwise you would need to refresh your browser multiple times until you eventually run out of RAM and crash the pi.

Thanking you,

Mark

What is the problem?

What did you already try to solve it?

Logs (octoprint.log, serial.log or output on terminal tab at a minimum, browser error console if UI issue ... no logs, no support!)

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)

If you've found a memory-related problem with a plugin, create an issue on their repository to open a dialog with the author. I'm sure they'll be delighted to hear about it.

Looks like he has @OutsourcedGuru, but also seems that the plugin author is no longer around or maintaining.

I guess the question would be to @mselkin, is the RAM on the Pi getting consumed because of using TouchUI or loading a full desktop on the Pi and loading the browser and the memory usage is killing the Pi from a client connection? I've recently gone on a client side memory leak chase with one of my plugins and it's not so easy to find these so far.

1 Like

I am not using touch UI but I am using a full desktop and chromium on the same Pi as octoprint, but the issue I am describing occurs when logging into the Pi from a remote computer and up to 10% of RAM is consumed with each connection.

I really like the ability to auto shut down the Pi and I do not have the knowledge to write a plugin - my post is a hope that someone could take interest in writing one or fixing it.

Hi guys,

In my continued hope that someone with the knowledge to program, write plugins could help, I would like to share one more thing:

I have discovered that the issue I describe regarding the memory leak caused by AutomaticShutdown seems to only occur if you check the box in it's settings to allow it to remember the abort time, if you leave that box unchecked, for a default abort time of 30 seconds, then the memory leak does not occur.

Does that clue anyone in as to what might be happening?

Thanks agin,
Mark

I'm fairly familiar with this plugin as I integrated some of its features into the TPLinkSmartplug plugin recently and what you describe seems to indicate a potential knockout binding issue. The binding would only happen however on the client side, so only when a browser was connected. I guess the question I would have for you is does the same thing occur if you don't have the chromium on the pi opened?

Thanks for getting back to me, I shall investigate that and let you know.

Hi again, yes, I am still observing the issue without Chromium running on the pi. For now, I am able to use the plugin, as long as I don't check the setting to remember my last settings.

I have no knowledge of programming but after some internet research, I cloned the plugin on GitHub, edited the one file so that the initial settings are the ones I use and then I reinstalled my edited version of the plugin.

This allows me to function for now, without having to save my settings but of course this does not correct the memory leak bug.