LeakWatch
LeakWatch is a lightweight, easy-to-use Python library designed to help developers identify memory leaks and abnormal memory growth within Python applications.
Unlike traditional profilers that provide raw memory statistics, LeakWatch focuses on explaining:
- What is growing (which object types).
- Where it was created (source attribution / traceback).
- How fast it is growing (growth rate over time).
- Whether it is likely a memory leak (calculates a leak score).
Features
- Snapshot Comparison: Capture and compare memory states dynamically.
- Context Monitoring: Monitor code blocks or decorate functions using
monitor. - Source Attribution: Resolve file and line tracebacks for allocated objects.
- Leak Scoring: Intelligent heuristic to identify the probability of a leak.
- Command-Line Interface: Run your Python scripts under a monitor or export reports to JSON, Markdown, or HTML.
Installation
Install using pip:
pip install leakwatch-py
Quick Start
from leakwatch import watch
# Call watch at the start of your script
watch()
# Your application code runs...
For more examples, refer to the documentation or prd2.md.
Release files for leakwatch-py 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| leakwatch_py-1.0.0.tar.gz | 13.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| leakwatch_py-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.3 kB
Release files / leakwatch_py-1.0.0.tar.gz
| Download URL | leakwatch_py-1.0.0.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dbb56cc52ccb94591916731dd52b943bedbb3b858b71cae82629be98b5edecf7
|
|
BLAKE2b-256 checksum How to use checksums |
ea21c699538be95ee8a466f70463accf926292d512b3ea8907c9f60d07837c3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / leakwatch_py-1.0.0-py3-none-any.whl
| Download URL | leakwatch_py-1.0.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e8203a5945cccbbb4f43bf8018c0935964261f2fa2b732c3c69b0a80b36a419
|
|
BLAKE2b-256 checksum How to use checksums |
0608dcaa4b597ba6e199a2e19fbbc55c1b670a25060fce6f87e1fc9c9f348869
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|