# `SnakeBridge.Error.OutOfMemoryError`
[🔗](https://github.com/nshkrdotcom/snakebridge/blob/v0.14.0/lib/snakebridge/error/out_of_memory_error.ex#L1)

GPU out-of-memory error with recovery suggestions.

Provides detailed information about memory failures including
device info, memory stats, and actionable suggestions.

## Examples

    iex> error = %SnakeBridge.Error.OutOfMemoryError{
    ...>   device: {:cuda, 0},
    ...>   requested_mb: 8192,
    ...>   available_mb: 2048,
    ...>   message: "CUDA out of memory"
    ...> }
    iex> Exception.message(error)
    "GPU Out of Memory on CUDA:0..."

# `device`
[🔗](https://github.com/nshkrdotcom/snakebridge/blob/v0.14.0/lib/snakebridge/error/out_of_memory_error.ex#L21)

```elixir
@type device() :: :cpu | {:cuda, non_neg_integer()} | :mps | atom()
```

# `t`
[🔗](https://github.com/nshkrdotcom/snakebridge/blob/v0.14.0/lib/snakebridge/error/out_of_memory_error.ex#L23)

```elixir
@type t() :: %SnakeBridge.Error.OutOfMemoryError{
  __exception__: true,
  available_mb: non_neg_integer() | nil,
  device: device(),
  message: String.t(),
  python_traceback: String.t() | nil,
  requested_mb: non_neg_integer() | nil,
  suggestions: [String.t()],
  total_mb: non_neg_integer() | nil
}
```

# `new`
[🔗](https://github.com/nshkrdotcom/snakebridge/blob/v0.14.0/lib/snakebridge/error/out_of_memory_error.ex#L78)

```elixir
@spec new(
  device(),
  keyword()
) :: t()
```

Creates an OutOfMemoryError error with default suggestions.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
