Where does the data go when using file_uploader? When does it get deleted?

are there additional cases in place for streamlit cloud/sharing apps that would cause a file to be removed from RAM?

I have a private app that 12 or so users login (via google login) to use and am experiencing the following:

  1. after file upload, (and analysis occurs on the dataset): if the user leaves the tab open but does not interact with the webpage for some time, the file clears out at some point (like the app re-ran from the beginning --even though they did not click any radio buttons or widgets or anything that would case a re-run of the code from top to bottom)
  2. seemingly at random, users will upload a file, analysis will complete, and then the app reverts back to the start where they have to re-upload the file.

Is the RAM a shared resource between all users of the streamlit cloud app? they all login separately with their google credentials to use the app… I’m wondering if other users uploading files is causing their uploaded file to get removed from RAM therefore causing them to have to start from the beginning/re-upload the file? file size uploaded is a .csv, only 3-5MB max.

also worth noting:
I have not implemented @st.cache

  • my concern being that multiple users are using the app at the same time
  • would this cache be specific to their cloud instance/file upload (since they’re logging in with google account before uploading their files?). I do not want user A’s file to be cached and seen when user B logs in with their google account to use the app

the other solution I haven’t explored would be implementing session_state. same concerns as st.cache above.

are either of these (st.cache or st.session_state) the correct next steps for me to resolve the behavior my users are experiencing?