---
title: My function runs out of memory (OOM)
description: Troubleshoot issues encountered with Scaleway Serverless functions running out of memory and restarting.
tags: serverless functions troubleshooting issue error memory ram oom restart crash freeze bsod
dates:
  validation: 2025-12-03
  posted: 2025-12-03
---

## Problem

My function runs out of memory (OOM) and crashes or restarts.

## Possible cause
	
In sandbox v1 and v2, some directories are mounted as `tmpfs` for temporary in-memory storage. In Sandbox v2, directories such as `/tmp` and `/dev` are stored in memory.

Excessive writes to `/tmp` can fill up the provisioned memory, leading to out-of-memory (OOM) errors, potentially triggering a function restart.

## Solutions

- Avoid writing temporary files in `/tmp`.
- Use alternative storage paths within your function
- Increase the function's memory allocation to accommodate for temporary file usage

Refer to the [dedicated documentation](/serverless-functions/reference-content/functions-sandbox/) for more information on Sandboxes.