---
title: "Trace Python memory allocation hotspots before leaks and spikes reach production with Memray"
description: "Lets an agent record Python allocation traces and inspect the biggest allocators, retained objects, and leak paths before memory growth turns into a production incident."
verification: "security_reviewed"
source: "https://github.com/bloomberg/memray"
author: "Bloomberg"
publisher_type: "organization"
category:
  - "Monitoring & Alerts"
framework:
  - "Multi-Framework"
tool_ecosystem:
  github_repo: "bloomberg/memray"
  github_stars: 14986
  npm_package: "memray"
  npm_weekly_downloads: 16282665
---

# Trace Python memory allocation hotspots before leaks and spikes reach production with Memray

Lets an agent record Python allocation traces and inspect the biggest allocators, retained objects, and leak paths before memory growth turns into a production incident.

## Prerequisites

Python, pip or uv, memray CLI

## Installation

Choose whichever fits your setup:

1. Copy this skill folder into your local skills directory.
2. Clone the repo and symlink or copy the skill into your agent workspace.
3. Add the repo as a git submodule if you manage shared skills centrally.
4. Install it through your internal provisioning or packaging workflow.
5. Download the folder directly from GitHub and place it in your skills collection.

Install command or upstream instructions:

```
pip install memray
```

## Documentation

- https://bloomberg.github.io/memray/

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/trace-python-memory-allocation-hotspots-before-leaks-and-spikes-reach-production-with-memray/)
