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 usageflamegraphβ Generate an HTML flame graph for peak memory usagetableβ Generate an HTML table with all records in the peak memory usageliveβ Remotely monitor allocations in a text-based interfacetreeβ Generate a tree view in the terminal for peak memory usageparseβ Debug a results file by parsing and printing each record in itsummaryβ Generate a terminal-based summary report of the functions that allocate most memorystatsβ Generate high level stats of the memory usage in the terminaltransformβ Generate reports files in different formatsattachβ Begin tracking allocations in an already-started processdetachβ End the tracking started by a previousmemray attachcall
π 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
- debian trixie: python3-memray 1.17.0+dfsg-1+deb13u1
- ubuntu questing: python3-memray 1.17.0+dfsg-1
- ubuntu resolute: python3-memray 1.17.0+dfsg-1build1
- ubuntu stonking: python3-memray 1.17.0+dfsg-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms