direct.showbase.ContainerLeakDetector

from direct.showbase.ContainerLeakDetector import CheckContainers, ContainerLeakDetector, FPTObjsNamed, FPTObjsOfType, FindContainers, Indirection, NoDictKey, ObjectRef, PruneObjectRefs

Inheritance diagram

Inheritance diagram of direct.showbase.ContainerLeakDetector

class CheckContainers(name, leakDetector, index)[source]

Bases: Job

Job to check container sizes and find potential leaks; sub-job of ContainerLeakDetector

ReprItems = 5
__init__(self, name, leakDetector, index)[source]
destroy(self)[source]
getPriority(self)[source]
run(self)[source]
class ContainerLeakDetector(name, firstCheckDelay=None)[source]

Bases: 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 = {}
__init__(self, name, firstCheckDelay=None)[source]
addPrivateObj(obj)[source]
destroy(self)[source]
getContainerById(self, id)[source]
getContainerByIdGen(self, id, **kwArgs)[source]
getContainerIds(self)[source]
getContainerNameById(self, id)[source]
getContainerNameByIdGen(self, id, **kwArgs)[source]
getLeakEvent(self)[source]
getPathsToContainers(self, name, ot, doneCallback=None)[source]
getPathsToContainersNamed(self, name, on, doneCallback=None)[source]
notify = <direct.directnotify.Notifier.Notifier object>
removeContainerById(self, id)[source]
removePrivateObj(obj)[source]
run(self)[source]
class FPTObjsNamed(name, leakDetector, on, doneCallback=None)[source]

Bases: Job

__init__(self, name, leakDetector, on, doneCallback=None)[source]
destroy(self)[source]
finished(self)[source]
getPriority(self)[source]
run(self)[source]
class FPTObjsOfType(name, leakDetector, otn, doneCallback=None)[source]

Bases: Job

__init__(self, name, leakDetector, otn, doneCallback=None)[source]
destroy(self)[source]
finished(self)[source]
getPriority(self)[source]
run(self)[source]
class FindContainers(name, leakDetector)[source]

Bases: Job

Explore the Python graph, looking for objects that support __len__()

__init__(self, name, leakDetector)[source]
destroy(self)[source]
getPriority(self)[source]
getStartObjAffinity(startObj)[source]
run(self)[source]
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

__init__(self, evalStr=None, dictKey=<class 'direct.showbase.ContainerLeakDetector.NoDictKey'>)[source]
acquire(self)[source]
dereferenceDictKey(self, parentDict)[source]
destroy(self)[source]
getString(self, prevIndirection=None, nextIndirection=None)[source]
isDictKey(self)[source]
release(self)[source]
class NoDictKey[source]

Bases: object

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.)

class FailedEval[source]

Bases: Exception

__init__(self, indirection, objId, other=None)[source]
destroy(self)[source]
getContainerGen(self, getInstance=False)[source]
getEvalStrGen(self, getInstance=False)[source]
getFinalIndirectionStr(self)[source]
getNumIndirections(self)[source]
goesThrough(self, obj=None, objId=None)[source]
goesThroughGen(self, obj=None, objId=None)[source]
notify = <direct.directnotify.Notifier.Notifier object>
class PruneObjectRefs(name, leakDetector)[source]

Bases: Job

Job to destroy any container refs that are no longer valid. Checks validity by asking for each container

__init__(self, name, leakDetector)[source]
destroy(self)[source]
getPriority(self)[source]
run(self)[source]