Scroll to navigation

MEMRAY(1) User Commands MEMRAY(1)

NAME

memray - Memory profiler for Python applications

DESCRIPTION

usage: memray [-h] [-v] [-V]

{run,flamegraph,table,live,tree,parse,summary,stats,transform,attach,detach} ...

Memory profiler for Python applications

Run `memray run` to generate a memory profile report, then use a reporter command such as `memray flamegraph` or `memray table` to convert the results into HTML.

Example:

$ python3 -m memray run -o output.bin my_script.py
$ python3 -m memray flamegraph output.bin

positional arguments:

{run,flamegraph,table,live,tree,parse,summary,stats,transform,attach,detach}
Mode of operation
Run the specified application and track memory usage
Generate an HTML flame graph for peak memory usage
Generate an HTML table with all records in the peak memory usage
Remotely monitor allocations in a text-based interface
Generate a tree view in the terminal for peak memory usage
Debug a results file by parsing and printing each record in it
Generate a terminal-based summary report of the functions that allocate most memory
Generate high level stats of the memory usage in the terminal
Generate reports files in different formats
Begin tracking allocations in an already-started process
End the tracking started by a previous ``memray attach`` call

options:

show this help message and exit
Increase verbosity. Option is additive and can be specified up to 3 times
Displays the current version of Memray

Please submit feedback, ideas, and bug reports by filing a new issue at https://github.com/bloomberg/memray/issues

SEE ALSO

The full documentation for memray is maintained as a Texinfo manual. If the info and memray programs are properly installed at your site, the command

info memray

should give you access to the complete manual.

June 2024 memray 1.13.0