Skip to main content

Usage:

pip install mem_top
from mem_top import mem_top

# From time to time:
logging.debug(mem_top()) # Or just print().

Result:

refs:
144997  <type 'collections.defaultdict'> defaultdict(<type 'collections.deque'>, {<GearmanJobRequest task='...', unique='.
144996  <type 'dict'> {'.:..............:.......': <GearmanJobRequest task='..................', unique='.................
18948   <type 'dict'> {...
1578    <type 'dict'> {...
968     <type 'dict'> {...
968     <type 'dict'> {...
968     <type 'dict'> {...
767     <type 'list'> [...
726     <type 'dict'> {...
608     <type 'dict'> {...

types:
292499  <type 'dict'>
217912  <type 'collections.deque'>
72702   <class 'gearman.job.GearmanJob'>
72702   <class 'gearman.job.GearmanJobRequest'>
12340   <type '...
3103    <type '...
1112    <type '...
855     <type '...
767     <type '...
532     <type '...

Explaining result:

  • Noticed a leak of 6GB RAM and counting.

  • Added “mem_top” and let it run for a while.

  • When got the result above it became absolutely clear who is leaking here - the Python client of Gearman.

  • Found its known bug - https://github.com/Yelp/python-gearman/issues/10 leaking defaultdict of deques, and a dict of GearmanJobRequest-s, just as the “mem_top” showed.

  • Replaced “python-gearman” - long story: stale 2.0.2 at PyPI, broken 2.0.X at github, etc.

  • “mem_top” confirmed the leak is now completely closed.

Config defaults:

mem_top(limit=10, width=100, sep='\n', refs_format='{num}\t{type} {obj}', types_format='{num}\t {obj}')

Metadata

Release files for mem-top 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mem-top 0.1.0
File Size Uploaded Provenance Actions
mem_top-0.1.0.tar.gz 1.9 kB Without provenance Details for mem_top-0.1.0.tar.gz

Release files / mem_top-0.1.0.tar.gz

Download URL mem_top-0.1.0.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b870ef62fc18b310db61ef16aa982cbbea23aa08ff7b474b2eb1e8067630f61a
BLAKE2b-256 checksum
How to use checksums
2bd1db21af230c205e049b5a8fa3d03011964821fad7d547c54ca1be6befd376
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for mem-top 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page