How to tell resource limits vs. other errors?

Hi streamlit community!

I’m having trouble with the app deployed here:
https://pe-viewer.streamlit.app

In this github repo:

The app will run a few times, but then I routinely get this error message:

“Oh no. Error running app. If you need help, try the Streamlit docs and forums.”

I’m wondering: does this mean I’ve used too much memory, or could it be some other kind of problem?

I do have a challenge with this app, where I need to pull data from files of sizes around 500 MB, which I worry may be pushing up against the 1 GB memory limit. My second question is: if this a problem on reaching the memory limit, is it possible to raise the cap?

Finally, here’s what may be the most memory intensive bit of code. The files pulled from the web are 500 MB. I wonder if there might be some tricks to making this run while using less memory?

r = requests.get(url)
tfile = tempfile.NamedTemporaryFile(suffix='.h5')
tfile.write(r.content)
samples = read(tfile.name)

Note, the next step is to “downsample”, so the memory imprint should get immediately smaller. But I’m worried the initial read steps may be blowing the memory cap.

I’d appreciate any advice!

Hi @jonah,

It looks like this is a memory issue. Here’s a graph of your app’s memory usage over the past 24 hours:

You can see that it’s getting up to 3GB, and then presumably showed the “Oh no” error.

2 Likes

@Caroline Thank you! That is so helpful.

Is there a way I can make plots like that myself? I would love to be able to experiment to see if I can keep the usage below the cap.

Unfortunately, this functionality is only on our backend currently – however, this blog post covers how you can profile your app’s memory usage.

2 Likes

Thank you!!

1 Like