Octoprint maxing out RAM and crashing?

Hello all. I have ran into a little issue with my BPI M2 Zero OctoPrint box. Normally I do the SD card switcharoo with my Ender3 Pro (1.19 Marlin FW), I just load the gcode on the SD and use OctoPrint to print from that file. Due to that being inconvenient, I tried uploading from cura to my BPI and printing directly from the BPI. I noticed with a 2 hour long print job it was randomly stopping about half way though. I did not get any error notifications, I just so happened to check the print cam and noticed it was stopped. I checked the printer and then checked OctoPrint and nothing looked wrong except for it being at idle and the nozzle was all the way cooled down stopped mid print. I figured I must have pocket clicked something with OctoPod on my phone or something to stop it so I tried clearing everything and printing again this time with without having any UI up after the start of the print. AGAIN it made it about an hour and stopped just like before. I reset everything once again but this time printed directly from the SD card and no issues. I looked more into this since I would like this feature to work. This time I printed a 45 min job just so I could stay under the 1 hour mark. I then noticed the memory was almost maxed out on this print. I next tried disabling some plugins and restarted the BPI and again it was high but not as high as before. I verified this using the resource monitor plugin and also HTOP command from ssh. It looks like at idle OctoPrint is using 200Mb of ram. That sounds high to me. Can anyone confirm this is the same on their RPI or BPI? What would cause the RAM to keep adding up during the print? I would think the print would cause ram to surge during the transfers but should oscillate and not just ramp up? I think with the longer prints, it maxes out the RAM and then has to dump the RAM. This causes a reboot of OctoPrint. I could be wrong though.

Here are some screen shots

at idle I am using about 234MB
that is why the pi Zero isn't recommended, and the BPI Zero is just their clone of the Pi Zero. both only have 256MB Ram

Weird. Mine is 512. What causes the Ram to increase? The print servers at work generally do this kind of behavior when the driver isn’t working correctly and it the server doesn’t know what to do with the data.

My Pi4 2GB model claims to be using 351MB of RAM, actively printing now, with the web UI open (more is in use but compressed/suspended or whatever it it).

The logs (which were requested in the template when you opened this thread :wink:) would tell you if there is something failing/erroring, I have seen before where a large number of exceptions from something builds up memory usage.

The other thing you should try is safe mode to verify that it is not a plugin causing this problem.

Thanks for the response. I spaced out uploading the logs. I did however see a bunch of those error tornado access lines in the logs. I am going to try something with my apache2 server I have running and see id that helps. I will let you know.

It ended up crashing again. This is what the logs say. I guess I do not see anything unusual.

2021-01-30 00:01:08,953 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2021-01-30 00:16:08,957 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2021-01-30 00:31:08,959 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2021-01-30 00:36:16,618 - octoprint.server.util.sockjs - INFO - New connection from client: 192.168.0.128
2021-01-30 00:36:16,974 - octoprint.server.util.flask - INFO - Passively logging in user D from 192.168.0.128
2021-01-30 00:36:16,976 - octoprint.access.users - INFO - Logged in user: D
2021-01-30 00:36:17,175 - octoprint.server.util.sockjs - INFO - User D logged in on the socket from client 192.168.0.128
2021-01-30 00:36:19,263 - octoprint.server.util.flask - INFO - Passively logging in user D from 192.168.0.128
2021-01-30 00:36:19,264 - octoprint.access.users - INFO - Logged in user: D
2021-01-30 00:36:19,591 - octoprint.server.util.sockjs - INFO - Client connection closed: 192.168.0.128
2021-01-30 00:36:21,631 - octoprint.server.util.sockjs - INFO - New connection from client: 192.168.0.128
2021-01-30 00:36:21,733 - octoprint.server.util.flask - INFO - Passively logging in user D from 192.168.0.128
2021-01-30 00:36:21,734 - octoprint.access.users - INFO - Logged in user: D
2021-01-30 00:36:23,023 - octoprint.server.util.sockjs - INFO - User D logged in on the socket from client 192.168.0.128
2021-01-30 00:36:26,066 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from https://plugins.octoprint.org/plugins.json
2021-01-30 00:36:38,048 - octoprint.server.util.sockjs - INFO - Client connection closed: 192.168.0.128
2021-01-30 00:36:47,723 - octoprint.server.util.sockjs - INFO - New connection from client: 192.168.0.128
2021-01-30 00:36:48,732 - octoprint.server.util.flask - INFO - Passively logging in user _api from 192.168.0.128
2021-01-30 00:36:48,733 - octoprint.access.users - INFO - Logged in user: _api
2021-01-30 00:36:49,066 - octoprint.server.util.sockjs - INFO - User _api logged in on the socket from client 192.168.0.128
2021-01-30 00:37:18,553 - octoprint.server.util.sockjs - INFO - Client connection closed: 192.168.0.128
2021-01-30 00:37:26,549 - octoprint.server.util.flask - INFO - Passively logging in user D from 192.168.0.128
2021-01-30 00:37:26,550 - octoprint.access.users - INFO - Logged in user: D
2021-01-30 00:37:27,774 - octoprint.server.util.sockjs - INFO - New connection from client: 192.168.0.128
2021-01-30 00:37:27,885 - octoprint.server.util.flask - INFO - Passively logging in user D from 192.168.0.128
2021-01-30 00:37:27,894 - octoprint.access.users - INFO - Logged in user: D
2021-01-30 00:37:29,346 - octoprint.server.util.sockjs - INFO - User D logged in on the socket from client 192.168.0.128
2021-01-30 00:38:12,118 - octoprint.server.util.sockjs - INFO - Client connection closed: 192.168.0.128
2021-01-30 00:40:43,295 - octoprint.server.util.sockjs - INFO - New connection from client: 192.168.0.128
2021-01-30 00:40:43,408 - octoprint.server.util.flask - INFO - Passively logging in user D from 192.168.0.128
2021-01-30 00:40:43,409 - octoprint.access.users - INFO - Logged in user: D
2021-01-30 00:40:43,514 - octoprint.server.util.sockjs - INFO - User D logged in on the socket from client 192.168.0.128
2021-01-30 00:40:51,805 - octoprint.server.util.sockjs - INFO - Client connection closed: 192.168.0.128
2021-01-30 00:40:55,820 - octoprint.server.util.sockjs - INFO - New connection from client: 192.168.0.128
2021-01-30 00:40:56,422 - octoprint.server.util.flask - INFO - Passively logging in user _api from 192.168.0.128
2021-01-30 00:40:56,424 - octoprint.access.users - INFO - Logged in user: _api
2021-01-30 00:40:56,567 - octoprint.server.util.sockjs - INFO - User _api logged in on the socket from client 192.168.0.128
2021-01-30 00:41:46,137 - octoprint.server.util.sockjs - INFO - Client connection closed: 192.168.0.128
2021-01-30 00:46:08,967 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2021-01-30 01:01:08,987 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2021-01-30 01:16:08,990 - octoprint.server.heartbeat - INFO - Server heartbeat <3

Next thing I am going to try is a new power supply.

The power supply did not help but safe mode seemed to fix the issue. I guess I will have to pinpoint which one is causing the issue.

2 Likes

It looks to be related with octopod app. Removed that plugin and now its working great and ram usage is around 50mb.