# Out of memory

Source: https://docs.fortrabbit.com/dev/performance/out-of-memory
Published: 2026-10-01
Reviewed: 2026-10-01

> When PHP or jobs need more memory than the plan provides, a process gets killed. How to spot OOM kills in the metrics, find the cause, and stop them.


## About OOM kills

Each PHP or jobs plan comes with a fixed amount of memory, shared by all its processes. A single process can stay within the PHP `memory_limit` and still push the total over the plan. Then a process gets killed. The healthy number of OOM kills is zero.

The [metrics](/platform/settings/metrics) show both sides: memory use against the plan sizes, and the kills that follow.

## PHP

A killed PHP process ends the request it was handling, and the visitor gets an error page. Kills often line up with [503 errors](/dev/http-status-codes/503).

- Single kills usually come from one heavy request, such as an export or an image upload.
- Repeated kills at busy times mean too many processes for the memory of the plan.
- Memory that is high while PHP requests are low points to code that loads too much at once: large result sets, images processed in memory.

Find the peak in the PHP memory metric, then read the [logs](/platform/settings/logs) for the requests at that time. [PHP processes](/dev/performance/php-processes#php-memory-requirements) explains how processes share memory.

## Jobs

A killed worker or cron stops mid-job. Depending on the queue, the job is retried, lost, or left half done.

- Kills at fixed times point to a cron.
- Memory that climbs steadily and only drops on a restart points to a leak in a worker: each processed job leaves something behind.

Restart workers after a number of jobs or at a memory limit. Most queue libraries have an option for it. Process large data sets in batches. See [tune jobs](/platform/jobs/tuning).

## Fix or scale

Fix the code first: a request or job that loads less needs less memory on any plan. Scale the [PHP](/platform/components/php#scaling) or [Jobs](/platform/components/jobs#scaling) component when the memory use is legitimate.

---

- [Metrics](/platform/settings/metrics)
- [PHP processes](/dev/performance/php-processes)
- [Tune jobs](/platform/jobs/tuning)
