Streamlit server consistently failed status checks and potential memory leak

I’m currently working on a video processing web app but it crashes inconsistently.

I suspect it’s a memory issue but I haven’t been able to find any memory leaks. When I track the memory using psutil.virtual_memory(), it never reaches 100% but the app still crashes. It’s also very inconsistent, sometimes crashing around frame 90, but also sometimes being able to process the same exact video in its entirety without issue. I’m wondering if you guys have access to anything behind the scenes that might help me narrow down the reason for these crashes.

Steps to Reproduce:

  1. Upload Summer Nationals Clip.mp4 (attached)

  2. Wait for “File Processed” to appear

  3. Navigate to “Live Stream” through the sidebar

  4. Wait

Github Code: GitHub - BANANAPEEL202/FencingWebApp
App: https://bananapeel202-fencingwebapp-upload-xnj04o.streamlitapp.com/ (may have already crashed and require a reboot)
Test Video: Summer Nationals Clip.mp4 - Google Drive