bloomberg/memray

Memray is a memory profiler for Python

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 27 minutes ago
Added to GitGenius on September 3rd, 2026
Created on April 8th, 2022
Open Issues & Pull Requests: 37 (+0)
GitHub issues: Enabled
Number of forks: 459
Total Stargazers: 15,221 (+0)
Total Subscribers: 66 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Issue API getrepoissuespagesummary failed: 429 Rate limit exceeded. Please try again later.

Detailed Description

Memray is a memory profiler for Python that traces memory allocations across Python code, native extension modules, and the Python interpreter itself.

Memray addresses memory analysis by instrumenting every function call to build an accurate call stack, rather than relying on sampling. This approach captures allocations in both Python and native C/C++ code, providing a complete picture of where memory is being used. The tool generates multiple report formats including flame graphs to visualize memory usage patterns. It operates as both a command-line tool and a library, allowing developers to integrate profiling into their workflows at different levels of granularity.

Memray suits teams working on performance-critical Python applications or those debugging memory leaks in codebases that mix Python with native extensions. It is particularly valuable when sampling profilers miss important allocation patterns or when native code contributions to memory usage need investigation. The tool works with Python threads and native threads spawned from C extensions. However, adoption requires a Linux or macOS environment, as the tool does not support other platforms.

The project maintains active engagement with its user community through a dedicated discussion space for success stories. Development shows responsiveness to user feedback and a commitment to improving the tool based on real-world usage patterns. The codebase includes comprehensive binary dependencies and build infrastructure to support installation across different system configurations.