Streamlit App Crashes Unexpectedly


I have noticed a persistent issue with my deployed Streamlit app. The app suddenly crashes with the following (uninformative) message (and screenshot):

[manager] Error checking Streamlit healthz: Get "http://localhost:8501/healthz": dial tcp connect: connection refused
[manager] Streamlit server consistently failed status checks
[manager] Please fix the errors, push an update to the git repo, or reboot the app.

There is no issue with the code in the repository as I have made no changes plus the app runs perfect on locally on my device. Now, once I reboot the app, everything works perfectly again, then it crashes after a while. I cannot make sense of the error message so I can’t pinpoint the source.

Kindly advise. The log can be found here. Thank you.

Hi @Outsiders17711.

I’m suspecting a memory issue here, I’m also checking with our cloud engineers now to confirm this.

Out of curiosity, which libraries are you using?


Hello @Charly_Wargnier,

Thanks for your response. I am using the following libraries:

  • mediapipe==0.8.6
  • streamlit==0.86.0
  • numpy==1.20.2
  • opencv_contrib_python==

Plus, I had to add the following in a packages.txt to get the opencv to work:

  • freeglut3-dev
  • libgtk2.0-dev
  • libgl1-mesa-glx
  • tesseract-ocr
  • libtesseract-dev
  • libtesseract4
  • tesseract-ocr-all

Thank you.

1 Like


Let’s see what the cloud engineers are saying.

We’ll be back to you shortly.


1 Like

Btw @Outsiders17711, can you please provide the code + Sharing URL?


Hello @Charly_Wargnier,

Thanks for following up.

The code can be found at this repository. The main file is

The sharing URL is: The app is currently down. The latest logs are here.

Does that answer your question?

Thank you.

1 Like

Thanks @Outsiders17711!

Devs took a quick look - This is the log from Streamlit server, most likely a memory error:

2021-08-11 04:18:14,240 INFO exited: streamlit (terminated by SIGKILL; not expected)

We see in our metrics that the app has very quick spikes to ~3gb before crashing, so we would recommend you to try and work on the memory management of the app.

Good luck!


Helllo @Charly_Wargnier,

Thanks for your response and effort so far.

I’ll check out the memory management. Thanks a lot.

1 Like

You’re welcome!

Let us know how it goes! :balloon:


Hello @Charly_Wargnier ,

Thanks for the pointers. I took a look at my memory management and I found out I didn’t cache the Mediapipe classes. So, the Mediapipe models were being reread into memory every time the app ran. I fixed that and did some basic garbage collection and the app has been stable every since.

Thanks’ for the help.

1 Like

That’s great to hear @Outsiders17711!

Glad I’ve been able to help you! :slight_smile: