We built two small Streamlit apps and ran them with streamlit run on a Windows 11 laptop, using Streamlit 1.68.0 (released on 1 December 2026), Python 3.14.3 and pandas 3.1.2. A headless browser drove them through 60 reruns and up to seven tabs while psutil recorded the server process's memory. Below are Community Cloud's limits as Streamlit documents them today, what happens when an app goes over, why Streamlit apps grow, how to measure yours, and the fixes, with our numbers.
The short answer: Streamlit Community Cloud gives each app between 690 MB and 2.7 GB of memory, figures Streamlit dates "as of February 2024" and says may change without notice. An app over the limit slows down or shows "This app has gone over its resource limits", and a reboot is the only quick way out. Most Streamlit memory problems are caches without limits and per-user copies, not leaks in Streamlit: in our test an @st.cache_data with no limit grew 7.8 MB on every rerun, while max_entries=5 levelled off at 189 MB. Bound every cache with max_entries, ttl or max_size, load shared objects once with st.cache_resource, and load less data. Checked 2 December 2026.
Fastero
Host your Streamlit app for your team.
Deploy from GitHub with your team's login and secrets built in — no Docker, no auth proxy.
Try free →Streamlit Community Cloud's memory limit
Streamlit lists the limits on its "Manage your app" page; its "Status and limitations" page doesn't give them. "All Community Cloud users have access to the same resources and are subject to the same limits," it says, and "These limits may change at any time without notice." Then: "The limits as of February 2024 are approximately as follows":
| Resource | Minimum | Maximum |
|---|---|---|
| CPU | 0.078 cores | 2 cores |
| Memory | 690 MB | 2.7 GB |
| Storage | None | 50 GB |
Streamlit doesn't say what decides where in the range an app lands, and no paid tier raises the ceiling. The only route to more is an application: "We offer free resource increases only to support nonprofits or educational organizations on a case-by-case basis." The same page puts it another way: "If your app is not primarily used by a for-profit company you can apply for increased resources."
The rest of Community Cloud's limits, including the sleep after 12 hours without a visitor, are in our Community Cloud and paid hosting comparison and our guide to why Streamlit apps keep sleeping.
What happens when a Streamlit app runs out of memory
Streamlit's docs describe it this way: "If your app meets or exceeds its limits, it may slow down from throttling or become nonfunctional." The symptoms they list are:
- "Your app is running slowly."
- The app shows "This app has gone over its resource limits."
- A page that says Oh no. Streamlit adds: "If your app exceeds its resource limits, developers and viewers alike will see" it.
A developer signed in to the app can open Manage app in the lower-right corner "to reboot it and clear its memory". That buys time and nothing more; Streamlit's own guide to resource limits warns: "Rebooting can only fix your app temporarily". The same guide adds: "Based on our research, most of the time apps run over the resource limits because of memory."
On your own server the limit is a container's memory cap or the machine's RAM, and one Streamlit process serves everyone. Streamlit's architecture page says the server's machine "must be sized appropriately to handle concurrent users": one viewer's heavy filter can take the app down for every viewer at once.
Why Streamlit apps keep using more memory
Streamlit reruns your script from the top on every interaction, and that model makes a few kinds of growth easy to miss:
- Work repeated on every rerun. A model or big file loaded at the top of the script is loaded again on each click. Python usually frees the old one, but Streamlit's 2021 guide notes that "some libraries that manage their memory outside of Python (e.g. Tensorflow) do not release memory in a timely manner, especially in a threaded environment like Streamlit."
- Caches with no limit.
max_entriesdefaults to "None for an unbounded cache", andttldefaults to never expiring. Every new argument value adds an entry: a new date, a new search term, a new uploaded file passed to a cached function. Streamlit's caching guide names the result: "The app runs out of memory because the cache is too large." - Copies from
st.cache_data. "Each caller of the cached function gets its own copy of the cached data." A 100 MB cached DataFrame costs 100 MB in the cache plus 100 MB for every run using it at that moment. - Session State is per tab. "Each browser tab or window creates its own WebSocket connection, resulting in a separate session within your app." Whatever you put in
st.session_stateis multiplied by the number of open tabs, and more on how Session State works is in our guide. - Closed tabs linger. The server keeps a disconnected session for
server.disconnectedSessionTTL, 120 seconds by default, and Streamlit's config help says only that "The server may choose to clean up session state, uploaded files, etc" after that. Our measurement below shows what that means in practice. - Uploads.
st.file_uploaderaccepts files up to 200 MB each by default, and Streamlit 1.68's upload manager keeps them in the server's memory while a session holds them.
A true leak, memory that's never released however long you wait, is rarer. Streamlit found one in its own Session State code in versions before 1.0, and its 2022 write-up says that after the fix "apps started using one-tenth to one-twentieth of the memory used before". On a current version, look at your caches and sessions first.
We measured it: a cache with and without a limit
The test app loads one day of invented orders per rerun, 250,000 rows in four columns: 8.0 million bytes, or 7.6 MB, in pandas. Each rerun asks for the next day, as if a viewer kept picking a new date, so every rerun adds an entry to the cache. The app records the server's memory with psutil at the end of each run, then calls st.rerun() for the next day. The whole script, cache_growth.py:
import os
import time
import numpy as np
import pandas as pd
import psutil
import streamlit as st
LIMIT = os.environ.get("CACHE_LIMIT", "none")
RUNS = int(os.environ.get("RUNS", "60"))
LOG = os.environ["MEM_LOG"]
DECORATORS = {
"none": st.cache_data, # no limit: one entry per day, kept forever
"max_entries": st.cache_data(max_entries=5), # keeps the 5 newest entries
"max_size": st.cache_data(max_size="50MB"), # keeps entries up to 50 MB pickled (Streamlit 1.67+)
}
@DECORATORS[LIMIT]
def load_day(day: int) -> pd.DataFrame:
"""One day of invented orders: 250,000 rows, about 8 MB."""
rng = np.random.default_rng(day)
n = 250_000
return pd.DataFrame({
"order_id": np.arange(n, dtype=np.int64),
"amount": rng.gamma(2.0, 30.0, n),
"region": rng.integers(0, 8, n),
"units": rng.integers(1, 20, n),
})
st.session_state.setdefault("day", 0)
day = st.session_state.day
df = load_day(day)
st.metric(f"Day {day + 1}: revenue", f"${df['amount'].sum():,.0f}")
rss = psutil.Process().memory_info().rss # this script runs inside the server process
with open(LOG, "a", encoding="utf-8") as f:
f.write(f"{LIMIT},{day + 1},{time.time():.3f},{rss}\n")
if day + 1 < RUNS:
st.session_state.day += 1
st.rerun()
else:
if os.environ.get("CLEAR_AT_END"):
del df
load_day.clear() # empty this function's cache; st.cache_data.clear() empties all of them
time.sleep(1)
with open(LOG, "a", encoding="utf-8") as f:
f.write(f"{LIMIT}-cleared,{day + 1},{time.time():.3f},{psutil.Process().memory_info().rss}\n")
st.success("done")We started it with streamlit run once per setting (CACHE_LIMIT set to none, max_entries or max_size, a file path in MEM_LOG, and CLEAR_AT_END=1 on the unbounded run) and opened it in headless Edge, which ran the 60 reruns:

Server memory over 60 reruns for three cache settings, measured with psutil on Streamlit 1.68.0, Windows 11, 2 December 2026.
What the run showed:
- The idle server used 72 MB, and the first run took it to 149 MB: pandas and NumPy imported and one DataFrame cached.
- With no limit, memory rose by 7.8 MB on every rerun, to 608 MB after 60. The line never bends.
max_entries=5stopped growing at the fifth rerun, at 189 MB, andmax_size="50MB"at the sixth, at 196 MB. Both drop old entries as new ones arrive.load_day.clear()on the unbounded cache brought it back to 143 MB a second later.
Streamlit's own counter agreed. With max_entries=5, the cache_memory_bytes figure that Streamlit reports (more on that below) read 40,005,790 bytes: five entries of 8.0 million bytes each. As an estimate only, at 7.8 MB per new entry the unbounded app would reach a 2.7 GB ceiling after about 340 distinct days requested. Community Cloud runs Linux, so its starting point would differ from our laptop's, but the slope is the point: an unbounded cache always gets there.
Many users: a copy per tab, or one shared copy
The second app holds a 100 MB lookup table (3.2 million invented customers) in one of four ways. We opened six tabs one after another, then closed them all and kept measuring for three minutes:
| How the table is held | 1 tab | 6 tabs | 3 minutes after closing |
|---|---|---|---|
Built into st.session_state in each tab |
230 MB | 718 MB | 718 MB |
st.cache_data, copy kept in st.session_state |
328 MB | 817 MB | 816 MB |
st.cache_data, used only during the run |
328 MB | 426 MB | 425 MB |
st.cache_resource, one shared object |
230 MB | 230 MB | 230 MB |
Every tab with its own copy added 98 MB. st.cache_resource held one object for all six tabs, 488 MB less than six copies, which is exactly the case Streamlit's caching guide warns about: "Each session loads the model from scratch, which takes up a huge amount of memory." The worst pattern is the common one in the second row: caching a DataFrame and then saving the returned copy into Session State, which pays for the cache and for one copy per tab.
The last column surprised us. Closing a tab ends the session for the viewer, but the memory stayed put for three minutes, past the 120-second TTL. We repeated the six-tab run, waited 135 seconds after closing the tabs, then opened and closed a seventh tab: memory went from 817 MB to 329 MB within half a second of that last tab closing. In 1.68's code, expired sessions are cleared out when the server next stores a disconnected session, so a busy app frees them steadily and a quiet one may hold them until the next visitor leaves. Session-scoped caches (scope="session") behave better: they're emptied when the session disconnects.
Host your Streamlit app for your team.
Start free →How to check a Streamlit app's memory usage
-
Show the process's memory in the app. One line in the sidebar, while you debug:
import psutil import streamlit as st st.sidebar.caption(f"Server memory: {psutil.Process().memory_info().rss / 2**20:,.0f} MB") -
Read Streamlit's metrics endpoint. The server publishes
/_stcore/metrics, which includes the size of eachst.cache_datafunction's cache. Against ourmax_entries=5app, with curl 8.17 on Windows:curl -s http://localhost:8501/_stcore/metrics | grep "^cache_memory_bytes"cache_memory_bytes{cache_type="st_cache_data",cache="__main__.load_day"} 40005790It counts pickled bytes, not the whole process. For Session State and
st.cache_resourceit reports item counts unless you setserver.enableExpensiveMemoryStats = true, which walks every object and can be slow. -
Size a DataFrame before you cache it with
df.memory_usage(deep=True).sum(). -
Watch the curve, not one number. Streamlit's guide to memory leaks attaches a profiler (
mprof run --attach <pid>) and loads the app with several sessions: "If the memory usage doesn't plateau, your app is leaking memory". To find which objects survive, it comparestracemallocsnapshots taken aftergc.collect().
How to fix a Streamlit memory leak
Work down the list; most apps are fixed by the first two.
-
Load shared objects once with
st.cache_resource. Models, database connections and read-only lookup tables belong here: one object, shared by every session, with no copies. Everything shares that one object, so don't change it in place; Streamlit's guide says "the return value must be thread-safe". -
Put a limit on every
st.cache_data. Usemax_entrieswhen you can count the entries you need,ttlwhen the data goes stale, andmax_size(new in Streamlit 1.67, released on 5 November 2026) when entries vary in size:@st.cache_data(max_entries=20, ttl="1h") def load_orders(day: str) -> pd.DataFrame: ... @st.cache_data(max_size="500MB") def load_large_dataset(path: str) -> pd.DataFrame: ...To cap every
st.cache_datafunction together, setmaxCacheDataSizeunder[server]in.streamlit/config.toml. Both count pickled bytes, "not total process memory", so leave headroom. Forst.cache_resource, attlalone won't keep memory down: "TTL expiration only happens when expired resources are accessed." -
Keep per-user data out of long-lived places. Don't copy a cached DataFrame into
st.session_state; call the cached function where you need it. If each user really needs their own data, use@st.cache_data(scope="session"), which is emptied when the tab disconnects. -
Clear what you no longer need.
load_day.clear()empties one function's cache,load_day.clear(arg)one entry, andst.cache_data.clear()orst.cache_resource.clear()everything. A button that calls it is a fair stopgap while you fix the cause. -
Load less. Select the columns you use, filter in SQL instead of in pandas, and shrink types. Changing a DataFrame of the same shape to smaller column types cut it by two thirds:
import numpy as np import pandas as pd rng = np.random.default_rng(1) n = 250_000 df = pd.DataFrame({ "order_id": np.arange(n, dtype=np.int64), "amount": rng.gamma(2.0, 30.0, n), "region": rng.integers(0, 8, n), "units": rng.integers(1, 20, n), }) print(f"default dtypes: {df.memory_usage(deep=True).sum() / 2**20:.1f} MB") small = df.astype({"order_id": "int32", "amount": "float32", "region": "int8", "units": "int8"}) print(f"smaller dtypes: {small.memory_usage(deep=True).sum() / 2**20:.1f} MB")Its output on Python 3.14.3 with pandas 3.1.2:
default dtypes: 7.6 MB smaller dtypes: 2.4 MBStreamlit's own advice for big files is "Move big datasets to a database". DuckDB in Python can query a Parquet or CSV file and return only the rows a chart needs.
-
Reboot only as a stopgap. It resets memory to the starting point, and an unbounded cache climbs back at the same rate.
When the app genuinely needs more memory
Some apps are simply big: a model that needs 6 GB, or a dataset users really do slice in memory. Fix the growth first, because a bigger machine only delays an unbounded cache, then pick a host with the memory you need. Our guide to deploying a Streamlit app covers Docker and the paid hosts.
Where Fastero fits
Fastero is an AI and data platform where people and AI agents work together on a team's data, and it hosts Streamlit apps behind your team's login. You import an app by pasting its Git repository's URL, st.secrets works as it does elsewhere, and colleagues sign in with their own accounts. On memory:
- Every app runs on 1 CPU and 2 GB as standard, so the fixes above matter here too.
- On Pro, an app can run on a bigger machine: 2 CPUs and 8 GB for $0.20 an hour, 4 CPUs and 16 GB for $0.40, or 8 CPUs and 32 GB for $0.80. It's charged by the second from money added to the balance, not from what Pro's $20 per editor a month includes.
- On Pro an app can stay always on. On Free an app sleeps when idle and wakes when someone opens it.
So an app that needs 16 GB for an afternoon costs $0.40 an hour on Pro, not a bigger server you keep paying for.

A Streamlit app hosted in Fastero. Invented data.
FAQ
What is the memory limit for Streamlit Community Cloud?
Streamlit lists 690 MB minimum and 2.7 GB maximum per app, with 0.078 to 2 CPU cores and up to 50 GB of storage. It dates those figures "as of February 2024" and says they may change without notice. There's no paid upgrade; nonprofits and educational organizations can apply for more.
Why does my Streamlit app keep using more memory?
Usually a cache with no limit, copies of data kept in Session State for every tab, or sessions from closed tabs that haven't been cleared yet. In our test an unbounded st.cache_data grew 7.8 MB with every new argument value. If memory keeps climbing with caches bounded and no new users, profile it for a real leak.
Does st.cache_data cause memory leaks?
Not by itself, but with no max_entries, ttl or max_size it keeps every result forever, which looks like a leak. It also hands each caller a copy. Bound it, and use st.cache_resource for one shared object.
How do I clear the Streamlit cache?
Call st.cache_data.clear() or st.cache_resource.clear() to empty all caches of that kind, or my_function.clear() for one function. In our test, clearing an unbounded cache took the server from 608 MB to 143 MB. On Community Cloud, rebooting the app from Manage app also clears memory.
Does closing a browser tab free a Streamlit app's memory?
Not straight away. The server keeps a closed tab's session for at least 120 seconds (server.disconnectedSessionTTL), and in our run on Streamlit 1.68 the memory was freed only when another tab later disconnected. Session-scoped caches are emptied as soon as the tab disconnects.
What's the difference between st.cache_data and st.cache_resource for memory?
st.cache_data stores a pickled copy and gives every caller a fresh copy, which is safe but costs memory per caller. st.cache_resource stores one object that every session shares. In our six-tab test, one shared 100 MB table used 230 MB in total, against 718 MB for six per-tab copies.
How do I get more memory for a Streamlit app?
First bound your caches and stop keeping per-tab copies. If the app still needs more, move it to a host with more RAM: your own server, a paid platform, or a bigger machine on Fastero Pro (up to 32 GB, by the hour).
Sources
Read on 2 December 2026, with our own runs on Streamlit 1.68.0, Python 3.14.3, pandas 3.1.2, NumPy 2.5.5 and psutil 7.2.2 on Windows 11.
- Streamlit docs: Manage your app (resource limits), Status and limitations, Argh. This app has gone over its resource limits, Caching overview, st.cache_data, st.cache_resource, Session State, Client-server architecture, st.file_uploader, config.toml, Release notes
- Streamlit on GitHub and its forum: Release 1.68.0, Increasing memory with caching (issue 6510), Common app problems: Resource limits (2021), 3 steps to fix app memory leaks (2022), Streamlit cache uses too much RAM
- Fastero: Pricing and machine sizes
Try Fastero free: host your Streamlit app behind your team's login, with a bigger machine by the hour on Pro when it needs one. No credit card required.
Fastero Dev Team