---
title: "Health Memory Debug"
method: GET
path: "/health/memory/debug"
---

# Health Memory Debug

`GET /health/memory/debug`

Read-only memory-leak diagnostics. 404s unless ``memory_debug_token``
is configured and matches ``token`` — inert in normal operation.

Always returns a gc object-type histogram (which TYPE is multiplying).
Drive tracemalloc explicitly: ``trace=start`` captures a baseline,
``trace=diff`` (later) returns the allocation SITES (file:line) that grew
since — i.e. where the leak is — and ``trace=stop`` ends tracing. Snapshots
use depth 1 and the whole collection runs in a worker thread so it never
blocks the event loop; tracing is never auto-started or auto-snapshotted.

## Query parameters

- `token` string
- `trace` string — 'start' | 'diff' | 'stop' | ''
- `top` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/repowise/apis/repowise-hosted-api.md) · [All operations](https://skmtc.dev/repowise/apis/repowise-hosted-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/repowise/repowise-hosted-api/revisions/1e57283a9737/schema)
