Getting error:[manager] Error checking Streamlit healthz: Get "http://localhost:8501/healthz":

Hello, I successfully deployed my app in streamlit
But when I try to run it more than 3 time, It crashes.

The log says
[manager] Error checking Streamlit healthz: Get "http://localhost:8501/healthz": dial tcp 127.0.0.1:8501: connect: connection refused [manager] Streamlit server consistently failed status checks

I understand the error is because of resource allocation,
but I am using st.cache here, so the file won’t be downloaded again

@st.cache
def download1(url1):
    url = url1
    filename = url.split('/')[-1]
    urllib.request.urlretrieve(url, filename)

download1(“https://github.com/Anubhav1107/streamlit/releases/download/fasterrcnn.pth/fasterrcnn.pth”)
The app is in
https://share.streamlit.io/anubhav1107/streamlit/streamlit.py

Thanks

Hi @Anubhav1107 -

In looking at your app, unfortunately I think this has to do with using Torch. As far as I can tell, your app doesn’t have any obvious flaws, but Torch is such a big dependency that running your app a few times then exhausts all available RAM, which causes the error you are seeing.

I’ll forward this thread on to our product and cloud teams, so they can have another example and possibly find a solution for this.

Best,
Randy

OK, thanks so much for looking @randyzwitch