direct.showbase.ContainerLeakDetector¶
from direct.showbase.ContainerLeakDetector import CheckContainers, ContainerLeakDetector, FPTObjsNamed, FPTObjsOfType, FindContainers, Indirection, NoDictKey, ObjectRef, PruneObjectRefs
Inheritance diagram
-
class
CheckContainers
(name, leakDetector, index)[source]¶ Bases:
direct.showbase.Job.Job
Job to check container sizes and find potential leaks; sub-job of ContainerLeakDetector
-
ReprItems
= 5¶
-
-
class
ContainerLeakDetector
(name, firstCheckDelay=None)[source]¶ Bases:
direct.showbase.Job.Job
Low-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.
-
PrivateIds
= {}¶
-
notify
= <direct.directnotify.Notifier.Notifier object>¶
-
-
class
FPTObjsNamed
(name, leakDetector, on, doneCallback=None)[source]¶ Bases:
direct.showbase.Job.Job
-
class
FPTObjsOfType
(name, leakDetector, otn, doneCallback=None)[source]¶ Bases:
direct.showbase.Job.Job
-
class
FindContainers
(name, leakDetector)[source]¶ Bases:
direct.showbase.Job.Job
Explore the Python graph, looking for objects that support __len__()
-
class
Indirection
(evalStr=None, dictKey=<class 'direct.showbase.ContainerLeakDetector.NoDictKey'>)[source]¶ Bases:
object
Represents 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:
object
stores 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>¶
-