Skip to main content

A Python library to identify memory leaks and abnormal memory growth

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leakwatch_py-1.0.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

leakwatch_py-1.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file leakwatch_py-1.0.0.tar.gz.

File metadata

  • Download URL: leakwatch_py-1.0.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for leakwatch_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dbb56cc52ccb94591916731dd52b943bedbb3b858b71cae82629be98b5edecf7
MD5 0efca20f874145ade431b5d04f1a3295
BLAKE2b-256 ea21c699538be95ee8a466f70463accf926292d512b3ea8907c9f60d07837c3d

See more details on using hashes here.

File details

Details for the file leakwatch_py-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: leakwatch_py-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for leakwatch_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e8203a5945cccbbb4f43bf8018c0935964261f2fa2b732c3c69b0a80b36a419
MD5 aea754d5c5418fe05514b503215fbdd3
BLAKE2b-256 0608dcaa4b597ba6e199a2e19fbbc55c1b670a25060fce6f87e1fc9c9f348869

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page