> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Persistence

A sandbox keeps its disk for its whole life, and keeps its memory and processes while paused. Nothing of a sandbox is kept after it terminates, its snapshots included.

| Layer | What Is Kept | Mechanisms |
| - | - | - |
| Disk | The root disk and the workspace disk | Kept from create to terminate, through every pause |
| Memory | Running processes, open files, sockets, and everything in RAM | Pause and resume, snapshots, forks |
| Beyond a sandbox | A ready-to-run image with its server started | [Templates](https://developers.telnyx.com/docs/edge-compute/sandboxes/organization-resources/templates.md) |

## Disk Persistence

A sandbox has a root disk, built from its image, and a separate workspace disk. Both keep every write until the sandbox terminates. A pause, a resume, a snapshot, and a change to the network policy never discard disk contents. See [Linux](https://developers.telnyx.com/docs/edge-compute/sandboxes/linux.md) for the paths and sizes.

## Memory Persistence

A pause stops the sandbox's virtual machine and saves its full memory, device state, and disks. A resume restores all of it on the same host. Processes continue from the instruction where they stopped, and their open files and in-memory state are intact.

* **Execs.** An exec that was running at the pause reads `interrupted` after the resume. Its process keeps running in the sandbox, but its output stream ends. Finished execs keep their output. See [Execs](https://developers.telnyx.com/docs/edge-compute/sandboxes/data-plane-operations/execs.md).
* **Network connections.** Sockets survive the pause inside the sandbox. A remote end may close a connection that stays silent for the length of the pause.
* **Timeout.** The `timeout` clock stops while the sandbox is paused.

A paused sandbox uses no CPU and does not count against the organization's [concurrency quota](https://developers.telnyx.com/docs/edge-compute/sandboxes/platform-properties/scale.md#capacity). A resume takes the quota back, and a resume refused for quota leaves the sandbox paused.

## Copies of a Sandbox

### Snapshots

A snapshot is a named copy of a running sandbox's memory and disks. The source keeps running while the snapshot is taken. A new sandbox created `from` a snapshot starts with the processes and files the source had at that moment. A snapshot is usable while its source exists, and is removed when the source terminates. See [Snapshots](https://developers.telnyx.com/docs/edge-compute/sandboxes/common-control-plane/snapshots.md).

### Forks

A fork creates one or more new sandboxes from a running sandbox's live state in one request. Each sibling is independent from its first instruction and outlives its source. The source keeps running. See [Fork](https://developers.telnyx.com/docs/edge-compute/sandboxes/common-control-plane/user-controlled-lifecycle.md#fork).

## Persistence Beyond a Sandbox

A template is a named image that the platform boots once, starts, and checkpoints when it is ready. Every sandbox created from it resumes that checkpoint. A template exists until it is deleted, independently of every sandbox. See [Templates](https://developers.telnyx.com/docs/edge-compute/sandboxes/organization-resources/templates.md).

A snapshot published as a template Preview will keep a sandbox's live state after the sandbox terminates.

## Retention

| Interval | Applies To | Default | Effect |
| - | - | - | - |
| `timeout` | A `running` sandbox | 300 seconds | `on_timeout`: `terminate` (default) or `pause` |
| `idle_timeout` | A `running` sandbox with no activity | None | `on_idle`: `pause` (default) or `terminate` |
| Paused retention | A `paused` sandbox | 7 days | Terminates with `termination_reason` `paused_expired` |
| Lifecycle events | Every sandbox | 7 days | Events older than the retention are removed |

The `timeout` clock counts only time spent running. [Common Control Plane](https://developers.telnyx.com/docs/edge-compute/sandboxes/common-control-plane/platform-managed-lifecycle.md) explains activity, the timeout requests, and the minimum lifetime after a resume.

## Opting Out of Persistence

A sandbox created with the default `timeout` and `on_timeout` terminates after 300 seconds of running and discards its state. A terminate request discards it at once. Terminated sandboxes keep no disk and are never resumable.
