snippetbashTip
memray — Profile memory usage of a Python application. More information: <https://github.com/bloomberg/memray
Viewed 0 times
usagecommandpythonmemraymemorycliprofileapplication
Problem
How to use the
memray command: Profile memory usage of a Python application. More information: <https://github.com/bloomberg/memray#usage>.Solution
memray — Profile memory usage of a Python application. More information: <https://github.com/bloomberg/memray#usage>.Run a Python file and track memory usage:
memray run {{path/to/file}}.pyRun a [m]odule and track memory usage:
memray run -m {{module_name}}Specify an output name:
memray run {{[-o|--output]}} {{path/to/output_file}}.bin {{path/to/file}}.pyDisplay a summary of memory usage:
memray summary {{path/to/file}}.binGenerate an HTML flamegraph:
memray flamegraph {{path/to/file}}.binCode Snippets
Run a Python file and track memory usage
memray run {{path/to/file}}.pyRun a [m]odule and track memory usage
memray run -m {{module_name}}Specify an output name
memray run {{[-o|--output]}} {{path/to/output_file}}.bin {{path/to/file}}.pyDisplay a summary of memory usage
memray summary {{path/to/file}}.binGenerate an HTML flamegraph
memray flamegraph {{path/to/file}}.binContext
tldr-pages: common/memray
Revisions (0)
No revisions yet.