Skip to main content

A memory profiler for Python applications

Project description

memray

Tests Linux Wheels Code Style

Memray output

Memray is a memory profiler for Python. It can track memory allocations both in Python code and native extensions and generate various reports to help analyze memory usage in libraries and applications. It can be used as a CLI tool or as a library to perform more fine-grained profiling tasks.

Notable features:

  • 🕵️‍♀️ Traces every function call so it can accurately represent the call stack, unlike sampling profilers.
  • ℭ Also handles native calls in C/C++ libraries so the entire call stack is present in the results.
  • 🏎 Blazing fast! Profiling causes minimal slowdown in the application. Tracking native code is somewhat slower, but this can be enabled or disabled on demand.
  • 📈 It can generate various reports about the collected memory usage data, like flame graphs.
  • 🧵 Works with Python threads.
  • 👽🧵 Works with native-threads (e.g. C++ threads in C extensions).

Memray can help with the following problems:

  • Analyze allocations in applications to help reduce memory usage.
  • Find memory leaks.
  • Find hotspots in code which cause a lot of allocations.

Note that memray only works on Linux and cannot be installed on other platforms.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memray-1.0.2.tar.gz (914.0 kB view hashes)

Uploaded Source

Built Distributions

memray-1.0.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64

memray-1.0.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl (4.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.12+ i686

memray-1.0.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

memray-1.0.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl (4.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

memray-1.0.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

memray-1.0.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl (4.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

memray-1.0.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.5 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

memray-1.0.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl (4.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page