Package: guppy3
Guppy 3A Python Programming Environment & Heap analysis toolset.This package contains the following subpackages:etc - Support modules. Contains especially the Glue protocol module.gsl - The Guppy Specification Language implementation. This can be used
to create documents and tests from a common source.heapy - The heap analysis toolset. It can be used to find information about
the objects in the heap and display the information in various ways.sets - Bitsets and 'nodesets' implemented in C.Guppy 3 is a fork of Guppy-PE, created by Sverker Nilsson for Python 2.RequirementsYou should have Python 3.8, 3.9, 3.10, 3.11, or 3.12. This package is CPython
only; PyPy and other Python implementations are not supported. Python 2 support
can be obtained fromguppy-peby
Sverker Nilsson, from which this package is forked.To use the graphical browser, Tkinter is needed.
To use the remote monitor, threading must be available.InstallationInstall with pip by:pip install guppy3Install with conda by:conda install -c conda-forge guppy3UsageThe following example showsHow to create the session context:h=hpy()How to show the reachable objects in the heap:h.heap()How to show the shortest paths from the root to the single largest object:h.heap().byid[0].spHow to create and show a set of objects:h.iso(1,[],{})>>>fromguppyimporthpy;h=hpy()>>>h.heap()Partitionofasetof30976objects.Totalsize=3544220bytes.IndexCount%Size%Cumulative%Kind(class/dictofclass)08292277390222173902221str178342562562418136464639tuple2207973006248166527047types.CodeType340012970888196235855type44168132792788224163663bytes5186962691368251077271function640012284646273923677dictoftype77901397044287894081dictofmodule810613933683297230884types.WrapperDescriptorType91721817122305402086dict(noowner)<89morerows.Typee.g.'_.more'toview.>>>>h.heap().byid[0].sp0:h.Root.i0_modules['os'].__dict__>>>h.iso(1,[],{})Partitionofasetof3objects.Totalsize=348bytes.IndexCount%Size%Cumulative%Kind(class/dictofclass)01332487124871dict(noowner)1133722132092list2133288348100int>>>People have written awesome posts on how to use this toolset, including:How to use guppy/heapy for tracking down memory usageDebugging Django memory leak with TrackRefs and GuppyDiagnosing Memory "Leaks" in PythonDigging into python memory issues in ckan with heapyFormal and API documentation arealso available.ContributingIssues and pull requests are welcome. You may also ask for help on using this
toolset; however, in such cases, we will only provide guidance, and not profile
your code for you.Please make sure to update tests as appropriate.TestingTo test if the heapy build and installation was ok, you can do:>>>fromguppyimporthpy>>>hpy().test()TestingsetsTest#0Test#1Test#2...There will be several more tests. Some tests may take a while.LicenseCopyright (C) 2005-2013 Sverker Nilsson, S. Nilsson Computer System ABCopyright (C) 2019-2021 YiFei ZhuCopyright (C) 2021-2023 YiFei Zhu, Google LLCThe right is granted to copy, use, modify and redistribute this code
according to the rules in what is commonly referred to as an MIT
license.This is not an official Google product.*** USE AT YOUR OWN RISK AND BE AWARE THAT THIS IS AN EARLY RELEASE ***