# Your app ran out of memory while starting up How to fix it.

URL: https://antideploy.com/blog/app-ran-out-of-memory-while-starting

Each app has 1 GB of memory, and a Java app has 2 GB. If your app loads something big when it starts, it can run out before it ever listens.

**What you see**

```
Your app built successfully, then ran out of memory while starting up and was
stopped before it could listen on port 8501.
```

## At a glance

- **What it means**: The app used all its memory
- **The limit**: 1 GB per app, 2 GB for Java
- **Fix one**: Load big things lazily
- **Fix two**: Use a hosted model

Published 7 October 2026. Facts checked 7 October 2026. 1 min read.

## What it means

The build worked. When the app started, it used all of its memory and was stopped before it could answer. Every app on Antideploy has 1 GB of memory, except a Java app, which has 2 GB. Because the app never reached a listening socket, the port is not the problem, and no start command would fix it.

## How to fix it

### 1. Find what loads at startup

A machine learning model, a large dataset, or a large file read into memory at import time is the usual cause.

### 2. Load it the first time it is needed

Load the model or data on the first request, not when the file loads. In Streamlit, cache it with `st.cache_resource`.

### 3. Or use a hosted model

Call a model over the network instead of loading its weights. Your agent can create an AI key for you. See [how to add AI to your app](https://antideploy.com/blog/how-to-add-ai-to-your-app).

## Memory in Node.js

A Node.js app can also run out of memory. Look for large caches that grow without end, whole files read into memory, or a huge number of items held at once.

## Memory questions, answered.

Anything else? Write to us and a person answers.

[support@antideploy.com](mailto:support@antideploy.com)

### Can I get more memory?

Each app is 1 GB (a Java app is 2 GB), on every plan, today. If your app genuinely cannot start in that much, write to support@antideploy.com.

### How do I see memory use?

Not as a chart. Antideploy checks whether an app is running, crashing or out of memory about every five minutes, and emails you when it is down.

### Does this failed deploy cost anything?

No. Failed deploys never count against your plan.

## More guides, and the platform.

Each platform page covers one part of Antideploy: what it does, where it stops and the questions people ask. [See the whole platform](https://antideploy.com/platform), or [all the guides](https://antideploy.com/blog).

- [Your app built successfully but never started listening on its port](https://antideploy.com/blog/your-app-built-successfully-but-never-started-listening-on-its-port): The app built but never answered on its port. Read PORT, listen on 0.0.0.0 and check the logs.
- [How to deploy a Gradio app](https://antideploy.com/blog/how-to-deploy-a-gradio-app): Your entry file is found and run with python. Launch on 0.0.0.0 and PORT, and mind the 1 GB of memory.
- [How to deploy a Streamlit app](https://antideploy.com/blog/how-to-deploy-a-streamlit-app): Your entry file is found, Streamlit starts with the right flags, and WebSockets stay open.

- [Hosting](https://antideploy.com/platform/hosting)
- [Logs and monitoring](https://antideploy.com/platform/logs-and-monitoring)
- [Deployments](https://antideploy.com/platform/deployments)
- [AI models](https://antideploy.com/platform/ai-models)

Facts on this page were checked against the live platform on 7 October 2026.

## Deploy something. Start with one sentence.

Paste one sentence into your coding agent, click Approve once, and get a live link. No card, no trial clock.

To set this up, give your coding agent this sentence:

```text
Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.
```
