App crashes after uploading image files on/from mobile - but works fine on laptop

I recently deployed an App:
Link : https://juan-moctezuma-ai-computervision-imageprocessing.streamlit.app/
Github Repo: GitHub - Juan-Moctezuma/Ai_OCR_and_Image_Processing_Render_App at master
file for source code on Github: main_app.py

The App crashes AFTER loading a picture from mobile device, however
the app never crashes if it’s used on a laptop. In addition , once it crashes I have to reboot my app (Which is my ‘quick fix’ for this issue). Unsure if this is a memory issue or glitch that doesn’t allow streamlit apps to run on mobiles or if something is wrong (or missing) with my code - thank you!

Hey @Juan_M,

I looked into your app’s memory usage, and it appears that the memory usage is most likely causing the crashes. Here’s a graph of your app’s memory usage over the past 14 days:

As you can see, there are a few points where the memory usage spiked sharply (likely causing the app to crash).

Hi @Caroline ! gotcha - makes sense that this is a memory issue - thank you for replying!

Although is there a long-term solution (or short-term :thinking: ) for this issue ?

Streamlit Cloud is a free service with a 1GB resource limit. Sometimes it lets you go over per availability, but that is never a guarantee. It’s intended for educational purposes and to help people get started easily.

If your current app is using more resources than that, you’ll either have to figure out a way to make it more efficient or deploy it on another system if you want to avoid hitting the limit.

Looking at the sizes of the jumps shown in @Caroline’s response, I’d be curious if the mobile vs laptop issue is more of a coincidence or red herring. You could certainly try to profile your app’s memory usage yourself to investigate your code. (Note that caching is going to contribute to consumption as well.)

2 Likes

Hi @mathcatsand - once again - thank you for the detailed explanation :+1:

1 Like