From 8f5e92fe61fcbbe0ada5e3a04b81949f1ba7b6cd Mon Sep 17 00:00:00 2001 From: Chanin Nantasenamat <51851491+dataprofessor@users.noreply.github.com> Date: Sat, 20 Jan 2024 17:05:58 +0700 Subject: [PATCH] Create oh-no-error-running-app.md Created a self-serve post for a commonly encountered "Oh no" error. --- .../oh-no-error-running-app.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 content/kb/using-streamlit/oh-no-error-running-app.md diff --git a/content/kb/using-streamlit/oh-no-error-running-app.md b/content/kb/using-streamlit/oh-no-error-running-app.md new file mode 100644 index 000000000..69b23857e --- /dev/null +++ b/content/kb/using-streamlit/oh-no-error-running-app.md @@ -0,0 +1,47 @@ +--- +title: Oh no. Error running app +slug: /knowledge-base/using-streamlit/oh-no-error-running-app +--- + +# Oh no. Error running app + +## Resource limits + +All Streamlit Community Cloud users have access to the same resources and are subject to the same limits (1 GB of RAM). + +If your app exceeds its resource limits, developers and viewers alike will see '😦 Oh no.' + +
+App state: Oh no. Error running your app. +
+ +## Checking for errors + +If you see the '😦 Oh no.' message when viewing your app, first check your Cloud logs for any specific errors. If there are no errors in your Cloud logs you are likely dealing with a resource issue. In other words, the app may have exceeded its allocated resource limit. + +If you are logged into a developer account for an app over its limits, you can access "**Manage app**" from the lower-right corner of the app to reboot it and clear its memory. "**Manage app**" will be red and have a warning icon (error). + +![Developer view: Oh no. Error running your app.](/images/streamlit-community-cloud/app-state-oh-no-developer.png) + +## Optimizing the app + +There are a few things you can change in your app to make it less resource-hungry: + +- Reboot your app (temporary fix) +- Use `st.cache_data` or `st.cache_resource` to load models or data only once +- Restrict the cache size with `ttl` or `max_entries` +- Move big datasets to a database +- Profile your app's memory usage + +## Solution + +To address this issue, we highly recommend going through and implementing the suggestions in the following blog posts to prevent your app from hitting the resource limits and to detect if your Streamlit app leaks memory: + +- Common app problems: Resource limits +- 3 steps to fix app memory leaks + +The following blogs also provide userful tips for improving loading speed and performance: + +- How to improve Streamlit app loading speed +- 6 tips for improving your Streamlit app performance +