---
title: Detect memory and OOM failures in Vercel Functions
description: Fix out-of-memory (OOM) errors and memory limit exceeded crashes in Vercel serverless functions. Debug 5xx errors, monitor function memory usage, and prevent OOM failures before they impact production.
url: /kb/guide/detect-memory-and-oom-failures-in-serverless-functions
canonical_url: "https://vercel.com/kb/guide/detect-memory-and-oom-failures-in-serverless-functions"
published: 2026-06-02
last_updated: 2026-06-02
authors: Vercel
related:
  - /docs/functions
  - /docs/instant-rollback
  - /docs/functions/configuring-functions/memory
  - /docs/alerts
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---
<!-- docsgraph:related -->
## Related pages

> **For AI agents:** Follow these links to understand how this page connects to the rest of the Vercel ecosystem. For the full cross-link map (inbound, outbound, prerequisites, and semantic neighbors), see the .graph.md link below.

- [Debug Slow Functions](https://vercel.com/docs/functions/debug-slow-functions?from=related) — Diagnose and fix slow Vercel Functions using CLI tools, logs, and timing analysis.
- [Legacy Usage & Pricing](https://vercel.com/docs/functions/usage-and-pricing/legacy-pricing?from=related) — Learn about legacy usage and pricing for Vercel Functions.
- [Configure Alerts](https://vercel.com/docs/alerts/configure-alerts?from=related) — Configure alert rules and notification destinations for Vercel Observability alerts.
- [Configuring Functions](https://vercel.com/docs/functions/configuring-functions?from=related) — Learn how to configure the runtime, region, maximum duration, and memory for Vercel Functions.
- [Overview](https://vercel.com/docs/observability?from=related) — Observability on Vercel provides framework-aware insights enabling you to optimize infrastructure and application perfor
- [Troubleshooting Builds Failing with SIGKILL or Out of Memory Errors](https://vercel.com/kb/guide/troubleshooting-sigkill-out-of-memory-errors?from=related) — Learn how to troubleshoot builds failing with SIGKILL or Out of Memory errors on a Vercel Deployment.
- [Troubleshooting Build Error: "Serverless Function has exceeded the unzipped maximum size of 250 MB"](https://vercel.com/kb/guide/troubleshooting-function-250mb-limit?from=related) — Learn how to troubleshoot builds failing due to exceeding the maximum function size limit on Vercel.
- [How to stop Vercel Functions from timing out](https://vercel.com/kb/guide/what-can-i-do-about-vercel-serverless-functions-timing-out?from=related) — Vercel Functions that time out usually trace back to a few causes. Learn how Fluid Compute fixes most of them and how to
- [Investigate latency issues and slowness on Vercel](https://vercel.com/kb/guide/investigate-latency-issues-and-slowness?from=related) — Learn how to use Observability to investigate latency issues and slowness on Vercel.
- [How to Effectively Load Test Your Vercel Application](https://vercel.com/kb/guide/how-to-effectively-load-test-your-vercel-application?from=related) — Learn how to safely load test your Next.js app on Vercel. This guide covers realistic, policy-compliant testing of route

Full cross-link map for this page: [/kb/guide/detect-memory-and-oom-failures-in-serverless-functions.graph.md](/kb/guide/detect-memory-and-oom-failures-in-serverless-functions.graph.md)
<!-- /docsgraph:related -->


## Overview

When a [Vercel Function](https://vercel.com/docs/functions) runs out of memory, it exits with an error and returns a 5xx response to the caller. Vercel's anomaly detection picks this up without any configuration required. The moment a memory-related failure causes a spike in errors on a route, Vercel triggers an alert, runs an AI investigation to identify the root cause, and sends you a notification.

This guide explains how OOM failures surface in Vercel Alerts, how to monitor memory usage proactively before functions start failing, and how to use Alert Rules to route critical function errors to the right channel.

## How OOM failures surface in alerts

When a function hits its memory limit, the runtime terminates it and returns a 500 error. If enough requests fail in a short window, Vercel detects the 5xx spike and triggers an alert.

The AI investigation identifies the pattern and generates a plain-language title describing the root cause such as "Memory limit exceeded on `/api/chat`" or "5xx spike from function crashes on `/api/process`". You'll receive this summary in your email or Slack notification without having to dig through logs.

Alerts resolve automatically once error rates return to baseline e.g. after you [roll back the deployment](https://vercel.com/docs/instant-rollback) or increase the [function's memory limit](https://vercel.com/docs/functions/configuring-functions/memory).

## Monitor memory usage before functions fail

Vercel exposes memory metrics for your functions in the Observability dashboard. You can use these to spot functions approaching their limit before they start returning errors.

1. Go to [Observability Functions](https://vercel.com/d?to=%2F%5Bteam%5D%2F%5Bproject%5D%2Fobservability%2Fvercel-functions&title=Go+to+Observability+Functions) in your project.
   
2. Select the route you want to inspect.
   
3. Review the **Peak memory** chart (p99) alongside the provisioned memory limit.
   

A function consistently using 80–90% of its provisioned memory is at risk of OOM failures under traffic spikes or with larger payloads. To increase a function's memory limit, set the `memory` option in your `vercel.json`:

```json
{
  "functions": {
    "api/process.ts": {
      "memory": 3009
    }
  }
}
```

The default memory limit is 1024 MB. The maximum is 3009 MB on Pro and Enterprise plans.

## Route critical function alerts to your team

By default, Vercel sends all alert notifications by email. To make sure memory-related failures reach the right people immediately, you can create an Alert Rule that routes critical alerts to a dedicated Slack channel or webhook.

See [Filter to critical alerts only](https://vercel.com/docs/alerts) to learn how to set up Alert Rules.

## Next steps

- [View function memory metrics](https://vercel.com/d?to=%2F%5Bteam%5D%2F%5Bproject%5D%2Fobservability%2Fvercel-functions&title=Go+to+Observability+Functions) in **Observability** → **Functions**.
  
- [Configure memory limits](https://vercel.com/docs/functions/configuring-functions/memory) for individual functions in `vercel.json`.
  
- [Set up Alert Rules](https://vercel.com/docs/alerts?__vercel_draft=1#configure-alerts-with-alert-rules) to route critical alerts to Slack or a webhook.