Logging heap profiler
Project description
heapprof: A Logging Heap Profiler
heapprof is a logging, sampling heap profiler for Python 3.7+.
- "Logging" means that as the program runs, it steadily generates a log of memory allocation and release events. This means that you can easily look at memory usage as a function of time.
- "Sampling" means that it can record only a statistically random sample of memory events. This improves performance dramatically while writing logs, and (with the right parameters) sacrifices almost no accuracy.
It comes with a suite of visualization and analysis tools (including time plots, flame graphs, and flow graphs), as well as an API for doing your own analyses of the results.
heapprof is complementary to tracemalloc, which is a snapshotting heap profiler. The difference is that tracemalloc keeps track of live memory internally, and only writes snapshots when its snapshot() function is called; this means it has slightly lower overhead, but you have to know the moments at which you'll want a snapshot before the program starts. This makes it particularly useful for finding leaks (from the snapshot at program exit), but not as good for understanding events like memory spikes.
You can install heapprof with pip install heapprof. heapprof is released under the
MIT License.
You can read all the documentation at humu.github.io/heapprof.
Navigating the Repository
If you're trying to find something in the GitHub repository, here's a brief directory (since, like most Python packages, this is a maze of twisty subdirectories, all different):
heapprofcontains the Python package itself. (The API and visualization logic)_heapprofcontains the C/C++ package. (The core profiling logic)docs_srccontains the sources for the documentation, mostly as.mdand.rstfiles.docscontains the compiled HTML version ofdocs_src, created withtools/docs.pyand checked in.toolscontains tools useful when modifying heapprof itself.- And then there are the configuration files for all the tools:
setup.pyis the master build configuration for the PIP package..flake8and.pylintrcare the configuration for Python linting.CPPLINT.cfgis the configuration for C/C++ linting.mypy.iniis the configuration for Python type checking.Gemfileis for setting up Jekyll for documentation hosting._config.ymlis the configuration for Jekyll serving.docs/Makefileanddocs/conf.pyare the configuration for building the HTML docs image via Sphinx..circleciis the configuration for continuous integration testing.pyproject.tomland the rootrequirements.txtmakesetuptoolshappy.
- Additional directories which are .gitignored but which show up during use:
buildcontains C/C++ dependencies and their compiled images; it's managed bysetup.py._sitecontains the final Jekyll site which is served for documentation; it's created if you runbundle exec jekyll serveto run the docs web server locally.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file heapprof-1.0.2.macosx-10.15-x86_64.tar.gz.
File metadata
- Download URL: heapprof-1.0.2.macosx-10.15-x86_64.tar.gz
- Upload date:
- Size: 79.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70d696de161e4b2dcce58669b814d6b133896f1fee9b3d3fcfea155486c44a60
|
|
| MD5 |
1ab313ce3e2f9ada6f052213193d3fe1
|
|
| BLAKE2b-256 |
45a51325100c8e7019c1aa4b608b0ffe085c99dd009678b818ad4b325f68c9f8
|
File details
Details for the file heapprof-1.0.2-cp37-cp37m-win_amd64.whl.
File metadata
- Download URL: heapprof-1.0.2-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 61.7 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9333906ec899ba6afb2dceb957a415375c9528a538dcc28d6851bd8139b5217c
|
|
| MD5 |
8659dfe3c8b7352339764003e84cd262
|
|
| BLAKE2b-256 |
383bad1fc1d01173d7317ba2259dd9890522b97bf9af6697e01cf9643181c442
|