I’ve got a streamlit app deployed and recently users have reported that the app is crashing for them. Specifically their chrome tab aborts and throws an “Aw snap” error page, with the “details” section showing an Out of Memory error (doesn’t give much more information than that).
My first thought is that the streamlit app is forcing the browser tab to load too much information into memory. So this leads me to the question:
Is session state (or any other streamlit components) stored on client side, affecting the memory impact on a user’s machine? Or are they solely stored server side and thus should not affect browser memory.
I landed on this forum wondering the same. I was storing a loads of dfs in session state and it had indeed slowed down everything. It was pretty much killing the browser if you open the app on a phone.
I have now refactored to save the functions for fetching dfs in session state instead of dfs themselves. And the functions are decorated with st.cache_data so that the don’t make db calls each time.
This has significantly sped things, it is all snappy and happy now.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.