direct.showbase.ContainerLeakDetector¶
from direct.showbase.ContainerLeakDetector import CheckContainers, ContainerLeakDetector, FPTObjsNamed, FPTObjsOfType, FindContainers, Indirection, NoDictKey, ObjectRef, PruneObjectRefs
Inheritance diagram
digraph inheritance7cbf8145a1 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "CheckContainers" [URL="direct.showbase.ContainerLeakDetector.html#direct.showbase.ContainerLeakDetector.CheckContainers",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Job to check container sizes and find potential leaks; sub-job of ContainerLeakDetector"]; "Job" -> "CheckContainers" [arrowsize=0.75,style=""]; "ContainerLeakDetector" [URL="direct.showbase.ContainerLeakDetector.html#direct.showbase.ContainerLeakDetector.ContainerLeakDetector",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Low-priority Python object-graph walker that looks for leaking containers."]; "Job" -> "ContainerLeakDetector" [arrowsize=0.75,style=""]; "DirectObject" [URL="direct.showbase.DirectObject.html#direct.showbase.DirectObject.DirectObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="This is the class that all Direct/SAL classes should inherit from"]; "FPTObjsNamed" [URL="direct.showbase.ContainerLeakDetector.html#direct.showbase.ContainerLeakDetector.FPTObjsNamed",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "Job" -> "FPTObjsNamed" [arrowsize=0.75,style=""]; "FPTObjsOfType" [URL="direct.showbase.ContainerLeakDetector.html#direct.showbase.ContainerLeakDetector.FPTObjsOfType",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "Job" -> "FPTObjsOfType" [arrowsize=0.75,style=""]; "FindContainers" [URL="direct.showbase.ContainerLeakDetector.html#direct.showbase.ContainerLeakDetector.FindContainers",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Explore the Python graph, looking for objects that support __len__()"]; "Job" -> "FindContainers" [arrowsize=0.75,style=""]; "Indirection" [URL="direct.showbase.ContainerLeakDetector.html#direct.showbase.ContainerLeakDetector.Indirection",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Represents the indirection that brings you from a container to an element of the container."]; "Job" [URL="direct.showbase.Job.html#direct.showbase.Job.Job",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Base class for cpu-intensive or non-time-critical operations that"]; "DirectObject" -> "Job" [arrowsize=0.75,style=""]; "NoDictKey" [URL="direct.showbase.ContainerLeakDetector.html#direct.showbase.ContainerLeakDetector.NoDictKey",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "ObjectRef" [URL="direct.showbase.ContainerLeakDetector.html#direct.showbase.ContainerLeakDetector.ObjectRef",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="stores a reference to a container in a way that does not prevent garbage"]; "PruneObjectRefs" [URL="direct.showbase.ContainerLeakDetector.html#direct.showbase.ContainerLeakDetector.PruneObjectRefs",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Job to destroy any container refs that are no longer valid."]; "Job" -> "PruneObjectRefs" [arrowsize=0.75,style=""]; }- class CheckContainers(name, leakDetector, index)[source]¶
Bases:
JobJob to check container sizes and find potential leaks; sub-job of ContainerLeakDetector
- ReprItems = 5¶
- class ContainerLeakDetector(name, firstCheckDelay=None)[source]¶
Bases:
JobLow-priority Python object-graph walker that looks for leaking containers. To reduce memory usage, this does a random walk of the Python objects to discover containers rather than keep a set of all visited objects; it may visit the same object many times but eventually it will discover every object. Checks container sizes at ever-increasing intervals.
- notify = <direct.directnotify.Notifier.Notifier object>¶
- class FindContainers(name, leakDetector)[source]¶
Bases:
JobExplore the Python graph, looking for objects that support __len__()
- class Indirection(evalStr=None, dictKey=<class 'direct.showbase.ContainerLeakDetector.NoDictKey'>)[source]¶
Bases:
objectRepresents the indirection that brings you from a container to an element of the container. Stored as a string to be used as part of an eval, or as a key to be looked up in a dict. Each dictionary dereference is individually eval’d since the dict key might have been garbage-collected TODO: store string components that are duplicates of strings in the actual system so that Python will keep one copy and reduce memory usage
- class ObjectRef(indirection, objId, other=None)[source]¶
Bases:
objectstores a reference to a container in a way that does not prevent garbage collection of the container if possible stored as a series of ‘indirections’ (obj.foo -> ‘.foo’, dict[key] -> ‘[key]’, etc.)
- notify = <direct.directnotify.Notifier.Notifier object>¶