memray
Memray is a memory profiler for Python
File Explorer
Download Latest Version (.zip)- devcontainer.json
- devcontainer.json
- ---bug-report.yaml
- ---feature-request.yaml
- config.yml
- build.yml
- build_wheels.yml
- coverage.yml
- docs.yml
- news-check.yml
- sanity-check.yml
- test_uv_python.yml
- zizmor.yml
- dependabot.yml
- publisher.txt
- runtime-settings.txt
- transforms.txt
- alternatives.txt
- problems.txt
- distributing.txt
- enthought-plan.txt
- enthought-rfp.txt
- hacking.txt
- policies.txt
- pysource.txt
- release.txt
- repository.txt
- runtime-settings-processing.txt
- semantics.txt
- testing.txt
- todo.txt
- website.txt
- index.txt
- telco-bench.b
- __init__.py
- async_tree_base.py
- async_tree_memray.py
- deltablue_base.py
- deltablue_memray.py
- docutils_html_base.py
- docutils_html_memray.py
- fannkuch_base.py
- fannkuch_memray.py
- go_base.py
- go_memray.py
- hexion_base.py
- hexion_memray.py
- json_dumps_base.py
- json_dumps_memray.py
- json_loads_base.py
- json_loads_memray.py
- mdp_base.py
- mdp_memray.py
- meteor_context_base.py
- meteor_context_memray.py
- nbody_base.py
- nbody_memray.py
- nqueens_base.py
- nqueens_memray.py
- pickles_base.py
- pickles_memray.py
- pprint_format_base.py
- pprint_format_memray.py
- raytrace_base.py
- raytrace_memray.py
- regex_dna_base.py
- regex_dna_memray.py
- regex_effbot_base.py
- regex_effbot_memray.py
- regex_v8_base.py
- regex_v8_memray.py
- spectral_norm_base.py
- spectral_norm_memray.py
- sqlite_synth_base.py
- sqlite_synth_memray.py
- telco_base.py
- telco_memray.py
- __main__.py
- plot.py
- __init__.py
- benchmarks.py
- plot_defaut.png
- plot_native.png
- plot_python_allocators.png
- plot_python_allocators_+_native.png
- requirements.txt
- custom.css
- .gitattributes
- memray-flamegraph-fib.html
- memray-flamegraph-mandelbrot.html
- memray-flamegraph-nbody.html
- memray-flamegraph-sqlite.html
- circle_inner.png
- circle_inner_opt.png
- circle_outer.png
- circle_outer_opt.png
- codespaces_testing_tab.png
- complex_example.png
- exercise1_flamegraph.png
- exercise2_flamegraph.png
- exercise3_flamegraph_basic.png
- exercise3_flamegraph_native.png
- filter_thread_dropdown.png
- flamegraph_example.png
- gprof2dot_example.png
- icicle_flame_toggle.png
- inverted_flame_graph_for_inverted_example.png
- live_animated.webp
- live_different_thread.png
- live_disconnected.png
- live_running.png
- logo.png
- mandelbrot_operation_native.png
- mandelbrot_operation_non_native.png
- memray.png
- native_mode_debug.png
- native_mode_no_debug.png
- non_relevant_checkbox.png
- normal_flamegraph_for_inverted_example.png
- output.png
- plot_default_options.png
- plot_defaut.png
- plot_native.png
- plot_python_allocators.png
- plot_python_allocators_+_native.png
- plot_python_allocators_native.png
- ports_tab.png
- pymalloc.png
- pytest_cli_output.png
- quotes.png
- rss_vs_heap.png
- rss_vs_heap_no_free.png
- simple_example.png
- stats_example.png
- summary_example.png
- table_example.png
- temporal_high_water_mark_controls.png
- tree_example.png
- custom.js
- index.html
- fib.py
- mandelbrot-threaded.py
- mandelbrot.py
- requirements.txt
- example.py
- requirements.txt
- example.py
- README.rst
- __init__.py
- fibonacci.py
- __init__.py
- holding_onto_memory.py
- __init__.py
- lru_cache.py
- fibonacci.py
- holding_onto_memory.py
- lru_cache.py
- __init__.py
- test_exercise_1.py
- test_exercise_2.py
- test_exercise_3.py
- 1.rst
- 2.rst
- 3.rst
- additional_features.rst
- Dockerfile
- index.rst
- requirements-tutorial.txt
- api.rst
- attach.rst
- changelog.rst
- conf.py
- favicon.ico
- flamegraph.rst
- getting_started.rst
- index.rst
- jupyter_magic.rst
- licenses.rst
- live.rst
- Makefile
- manpage.rst
- memory.rst
- native_mode.rst
- overview.rst
- performance.rst
- python_allocators.rst
- run.rst
- stats.rst
- summary.rst
- supported_environments.rst
- table.rst
- temporary_allocations.rst
- transform.rst
- tree.rst
- .gitignore
- 943.feature.rst
- __init__.py
- flamegraph.py
- __init__.pxd
- algorithm.pxd
- alloc.h
- alloc.pxd
- CMakeLists.txt
- compat.cpp
- compat.h
- elf_shenanigans.cpp
- elf_utils.h
- exceptions.h
- frame_tree.h
- hooks.cpp
- hooks.h
- hooks.pxd
- inject.cpp
- linker_shenanigans.h
- logging.cpp
- logging.h
- logging.pxd
- lz4_stream.h
- macho_shenanigans.cpp
- macho_utils.h
- native_resolver.cpp
- native_resolver.h
- native_resolver.pxd
- pthread.pxd
- python_helpers.cpp
- python_helpers.h
- record_reader.cpp
- record_reader.h
- record_reader.pxd
- record_writer.cpp
- record_writer.h
- record_writer.pxd
- records.cpp
- records.h
- records.pxd
- sink.cpp
- sink.h
- sink.pxd
- snapshot.cpp
- snapshot.h
- snapshot.pxd
- socket_reader_thread.cpp
- socket_reader_thread.h
- socket_reader_thread.pxd
- source.cpp
- source.h
- source.pxd
- tracking_api.cpp
- tracking_api.h
- tracking_api.pxd
- __init__.py
- _attach.gdb
- _attach.lldb
- attach.py
- common.py
- flamegraph.py
- live.py
- parse.py
- run.py
- stats.py
- summary.py
- table.py
- transform.py
- tree.py
- __init__.py
- common.js
- common.test.js
- flamegraph.js
- flamegraph_common.js
- README.md
- table.js
- temporal_flamegraph.js
- bootstrap.min.css
- bootstrap.min.js
- d3-flamegraph.min.js
- d3-scale-chromatic.min.js
- d3.min.js
- dataTables.bootstrap4.min.js
- jquery.dataTables.min.js
- jquery.min.js
- lodash.min.js
- plotly.min.js
- popper.min.js
- .gitattributes
- flamegraph.css
- flamegraph.js
- flamegraph_common.js
- table.css
- table.js
- temporal_flamegraph.js
- __init__.py
- base.html
- classic_base.html
- flamegraph.html
- table.html
- temporal_flamegraph.html
- __init__.py
- _textual_hacks.py
- common.py
- flamegraph.py
- frame_tools.py
- module_tools.py
- stats.py
- summary.py
- table.py
- transform.py
- tree.css
- tree.py
- tui.css
- tui.py
- __init__.py
- __init__.pyi
- __main__.py
- _destination.py
- _errors.py
- _memray.pyi
- _memray.pyx
- _memray_test_utils.pyx
- _metadata.py
- _stats.py
- _stats.pyi
- _test.py
- _test_utils.pyi
- _thread_name_interceptor.py
- _version.py
- py.typed
- enable.m4
- lead-dot.m4
- libtool.m4
- ltoptions.m4
- ltsugar.m4
- ltversion.m4
- lt~obsolete.m4
- multi.m4
- override.m4
- unwind_ipinfo.m4
- warnings.m4
- .gitignore
- aclocal.m4
- alloc.c
- allocfail.c
- allocfail.sh
- atomic.c
- backtrace-supported.h.in
- backtrace.c
- backtrace.h
- btest.c
- compile
- config.guess
- config.h.in
- config.sub
- configure
- configure.ac
- debuginfod_support.h
- dwarf.c
- edtest.c
- edtest2.c
- elf.c
- fileline.c
- filenames.h
- filetype.awk
- install-debuginfo-for-buildid.sh.in
- install-sh
- instrumented_alloc.c
- internal.h
- Isaac.Newton-Opticks.txt
- LICENSE
- ltmain.sh
- macho.c
- Makefile.am
- Makefile.in
- missing
- mmap.c
- mmapio.c
- move-if-change
- mtest.c
- nounwind.c
- pecoff.c
- posix.c
- print.c
- read.c
- README.md
- simple.c
- sort.c
- state.c
- stest.c
- test-driver
- test_format.c
- testlib.c
- testlib.h
- ttest.c
- unittest.c
- unknown.c
- xcoff.c
- xztest.c
- zstdtest.c
- ztest.c
- 0001-Expose-some-internal-functions-of-libbacktrace.patch
- 0002-Add-debuginfod-support-to-libbacktrace.patch
- regenerate_libbacktrace.sh
- __init__.py
- misbehaving.cpp
- setup.py
- __init__.py
- main.py
- setup.py
- testext.cpp
- main.py
- native_ext.c
- setup.py
- sharedlib.c
- ext.c
- setup.py
- __init__.py
- test_api.py
- test_attach.py
- test_extensions.py
- test_greenlet.py
- test_ipython.py
- test_main.py
- test_native_tracking.py
- test_object_tracking.py
- test_processes.py
- test_pyarrow.py
- test_record_writer.py
- test_socket.py
- test_threads.py
- test_tracing.py
- test_tracking.py
- TestTUILooks.test_allocations_of_different_sizes.svg
- TestTUILooks.test_basic.svg
- TestTUILooks.test_basic_node_selected_leaf.svg
- TestTUILooks.test_basic_node_selected_not_leaf.svg
- TestTUILooks.test_biggest_allocations.svg
- TestTUILooks.test_hide_import_system.svg
- TestTUILooks.test_select_screen.svg
- TestTUILooks.test_show_uninteresting.svg
- TestTUILooks.test_show_uninteresting_and_hide_import_system.svg
- TestTUILooks.test_two_chains.svg
- TestTUILooks.test_two_chains_after_expanding_second.svg
- test_merge_threads.svg
- test_tui_basic[narrow-terminal-focus-header-long-snapshots].svg
- test_tui_basic[narrow-terminal-short-snapshots].svg
- test_tui_basic[very-wide-terminal-short-snapshots].svg
- test_tui_basic[wide-terminal-long-snapshots].svg
- test_tui_gradient.svg
- test_tui_pause[narrow-terminal-connected].svg
- test_tui_pause[narrow-terminal-disconnected].svg
- test_tui_pause[wider-terminal].svg
- test_unmerge_threads.svg
- __init__.py
- conftest.py
- test_allocation_lifetime_aggregator.py
- test_attach.py
- test_cli.py
- test_flamegraph_reporter.py
- test_frame_tools.py
- test_high_water_mark_aggregator.py
- test_highwatermark_command.py
- test_module_tools.py
- test_reader.py
- test_stats_reporter.py
- test_summary_reporter.py
- test_table_reporter.py
- test_templates.py
- test_tracker.py
- test_transform_reporter.py
- test_tree_reporter.py
- test_tui_reporter.py
- __init__.py
- conftest.py
- test_utils.py
- utils.py
- .babelrc
- .bumpversion.cfg
- .clang-format
- .gitignore
- .pre-commit-config.yaml
- asv.conf.json
- CMakeLists.txt
- CONTRIBUTING.md
- Dockerfile
- KEYS
- LICENSE
- Makefile
- NEWS.rst
- package-lock.json
- package.json
- pyproject.toml
- README.md
- valgrind.supp
- webpack.config.js
# Installation Guide
git clone https://github.com/bloomberg/memray
Downloads the entire project code from GitHub to your computer.
cd memray
Moves into the project folder you just downloaded.
2. Docker
Easy Recommended- Git Needed to download the project code from GitHub.
- Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker build -t memray .
Builds a runnable image based on the Dockerfile.
docker run -p 8080:80 memray
Runs the built image as an actual container.
3. CMake
Mediummkdir build && cd build
Creates a folder to hold the build output and moves into it.
cmake ..
Analyzes the source code and generates build configuration files (must be run inside the build folder).
make
Compiles the code based on the generated build configuration to produce an executable.
4. Node.js
Easynpm install
Downloads and installs the libraries listed in package.json.
npm start
Starts the development/run server.
5. Python
Easypython3 -m pip install memray
Installs the Python libraries listed in requirements.txt (or similar).
python3 -m venv ../memray-env/ # just an example, put this wherever you want
Runs the Python script (or module).
python3 -m pip install --upgrade pip
Installs the Python libraries listed in requirements.txt (or similar).
python3 -m pip install -e . --group test --group extra
Installs the Python libraries listed in requirements.txt (or similar).
$ python3 -m memray run -o output.bin my_script.py
Runs the Python script (or module).
Pulled directly from this repo's README.
6. Make
Medium- Git Needed to download the project code from GitHub.
- Make Usually pre-installed on Linux/macOS. On Windows, install separately (e.g. via MSYS2 or WSL).
make
Compiles the code based on the generated build configuration to produce an executable.
