Where is session state stored? Client or server side?

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.

Thanks

1 Like

Only the data that is sent to the browser (for displaying, plotting, etc.) affects the browser memory.

That’s what I expected. Storing large dataframes in session state (while having an impact on app memory), would not affect browser memory.

Thank you for the confirmation.

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.