Analysis updated 2026-06-24 · repo last pushed 2026-05-21
Find a memory leak in a long-running Python service by running it under memray and inspecting the flame graph
Cut peak RAM usage in a data pipeline by tracing native NumPy or pandas allocations
Generate an HTML report attached to a CI job showing memory growth over a test run
Watch a live memory view of a misbehaving worker process to spot the leaking call site
| bloomberg/memray | codelucas/newspaper | andkret/cookbook | |
|---|---|---|---|
| Stars | 15,019 | 15,043 | 15,082 |
| Language | Python | Python | Python |
| Last pushed | 2026-05-21 | — | — |
| Maintenance | Maintained | — | — |
| Setup difficulty | moderate | easy | easy |
| Complexity | 3/5 | 2/5 | 2/5 |
| Audience | developer | data | data |
Figures from each repo's GitHub metadata at analysis time.
Linux and macOS only, building from source needs libdebuginfod, libunwind, and lz4 development packages.
Memray is a memory profiler for Python, built and open sourced by Bloomberg. A memory profiler watches a running program and records every time it asks the computer for memory, then helps you see where the memory went. The point is to answer questions like why is my program using so much RAM, or where is it leaking memory over time. Memray tracks allocations made from Python code, from native extension modules written in C or C++, and from the Python interpreter itself. It traces every function call rather than sampling at intervals, so the call stack in its reports reflects what actually happened. It also follows native calls into C and C++ libraries, so the full path of a memory allocation through both languages is visible. The README says the slowdown from profiling is small in pure Python mode and larger when tracking native code, and that this can be turned on or off on demand. It handles Python threads and threads created from native code. The tool runs only on Linux and macOS, it does not install on Windows. It needs Python 3.7 or newer and is installed from PyPI with pip install memray. The project ships binary wheels for common platforms, with build-from-source instructions covering libdebuginfod, libunwind, and lz4 dependencies. The main way to use it is the memray command line. You run your script under memray run, which writes a binary recording, and then you generate reports from that recording: an HTML flame graph, an HTML table, a tree view, a textual summary, or live monitoring. The full README is longer than what was shown.
Memray is a memory profiler for Python from Bloomberg that records every allocation in Python and native C or C++ extensions, then produces flame graphs, tables, and live views.
Mainly Python. The stack also includes Python, C, C++.
Maintained — commit in last 6 months (last push 2026-05-21).
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.