MEMRAY(1)

✨ MEMRAY(1) ✨

okay bestie, you're reading the manual page for memray β€” that's a Memory profiler for Python applications, and it lives in the User Commands section, so you know it's legit. pull up a chair, grab a strawberry πŸ“, and let's get into it.


🌸 NAME 🌸

memray β€” Memory profiler for Python applications πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

here's the vibe, fr fr:

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

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

Memory profiler for Python applications β€” that's the whole thing, that's the assignment. πŸ‘‘

so the flow is: you run memray run to generate a memory profile report, and then you use a reporter command like memray flamegraph or memray table to convert the results into HTML. two-step glow-up, no cap.

Example, because examples are the moment:

$ 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

and each one of those modes? let's meet them, they're all iconic in their own way:

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

πŸŽ€ options:

  • -h, --help β€” show this help message and exit
  • -v, --verbose β€” Increase verbosity. Option is additive and can be specified up to 3 times
  • -V, --version β€” Displays the current version of Memray
bestie please β€” feedback, ideas, and bug reports? don't be shy. 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. that's your deep-dive era, go off ✨


okay that's the whole page, you ate it. πŸ’– this was memray 1.13.0, from June 2024 β€” literally iconic behavior, mwah πŸ’…πŸ¦‹

πŸ“¦ where this page comes from