Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ContainerLeakDetector Class Reference
Inheritance diagram for ContainerLeakDetector:
Job DirectObject

Public Member Functions

 __init__ (self, name, firstCheckDelay=None)
 
 addPrivateObj (cls, obj)
 
 destroy (self)
 
 getContainerById (self, id)
 
 getContainerByIdGen (self, id, **kwArgs)
 
 getContainerIds (self)
 
 getContainerNameById (self, id)
 
 getContainerNameByIdGen (self, id, **kwArgs)
 
 getLeakEvent (self)
 
 getPathsToContainers (self, name, ot, doneCallback=None)
 
 getPathsToContainersNamed (self, name, on, doneCallback=None)
 
 removeContainerById (self, id)
 
 removePrivateObj (cls, obj)
 
 run (self)
 
- Public Member Functions inherited from Job
 finished (self)
 
 getFinishedEvent (self)
 
 getJobName (self)
 
 getPriority (self)
 
 isFinished (self)
 
 printingBegin (self)
 
 printingEnd (self)
 
 resume (self)
 
 setPriority (self, priority)
 
 suspend (self)
 
- Public Member Functions inherited from DirectObject
 accept (self, event, method, extraArgs=[])
 
 acceptOnce (self, event, method, extraArgs=[])
 
 addTask (self, *args, **kwargs)
 
 detectLeaks (self)
 
 doMethodLater (self, *args, **kwargs)
 
 getAllAccepting (self)
 
 ignore (self, event)
 
 ignoreAll (self)
 
 isAccepting (self, event)
 
 isIgnoring (self, event)
 
 removeAllTasks (self)
 
 removeTask (self, taskOrName)
 

Static Public Attributes

 notify = directNotify.newCategory("ContainerLeakDetector")
 
 PrivateIds = set()
 
- Static Public Attributes inherited from Job
 Continue = None
 yield None is acceptable in place of yield Job.Continue
 
 Done = object()
 Yielded from the run() generator method when the job is done.
 
 Priorities = ScratchPad(Min=1, Low=100, Normal=1000, High=10000)
 
 Sleep = object()
 Yield any remaining time for this job until next frame.
 
- Static Public Attributes inherited from DirectObject
 accept_once = acceptOnce
 
 add_task = addTask
 
 detect_leaks = detectLeaks
 
 do_method_later = doMethodLater
 
 get_all_accepting = getAllAccepting
 
 ignore_all = ignoreAll
 
 is_accepting = isAccepting
 
 is_ignoring = isIgnoring
 
 remove_all_tasks = removeAllTasks
 
 remove_task = removeTask
 

Protected Member Functions

 _checkForLeaks (self, task=None)
 
 _getCheckTaskName (self)
 
 _getDestroyEvent (self)
 
 _getPruneTaskName (self)
 
 _pruneObjectRefs (self, task=None)
 
 _scheduleNextLeakCheck (self)
 
 _scheduleNextPruning (self)
 
- Protected Member Functions inherited from Job
 _cleanupGenerator (self)
 
 _getGenerator (self)
 
 _getJobId (self)
 
 _setFinished (self)
 
- Protected Member Functions inherited from DirectObject
 _addTask (self, task)
 
 _clearTask (self, task)
 

Protected Attributes

 _checkContainersJob
 
 _checkDelayScale
 
 _checkForLeaks
 
 _findContainersJob
 
 _id2ref
 
 _index2containerId2len
 
 _index2delay
 
 _nextCheckDelay
 
 _pruneContainersJob
 
 _pruneObjectRefs
 
 _pruneTaskPeriod
 
 _scheduleNextLeakCheck
 
 _scheduleNextPruning
 
 _serialNum
 
- Protected Attributes inherited from Job
 _finished
 
 _generator
 
 _id
 
 _name
 
 _printing
 
 _priority
 
 _pstats
 
- Protected Attributes inherited from DirectObject
 _taskList
 

Additional Inherited Members

- Static Protected Attributes inherited from Job
 _SerialGen = SerialNumGen()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
name,
firstCheckDelay = None )

Reimplemented from Job.

Member Function Documentation

◆ _checkForLeaks()

_checkForLeaks ( self,
task = None )
protected

◆ _getCheckTaskName()

_getCheckTaskName ( self)
protected

◆ _getDestroyEvent()

_getDestroyEvent ( self)
protected

◆ _getPruneTaskName()

_getPruneTaskName ( self)
protected

◆ _pruneObjectRefs()

_pruneObjectRefs ( self,
task = None )
protected

◆ _scheduleNextLeakCheck()

_scheduleNextLeakCheck ( self)
protected

◆ _scheduleNextPruning()

_scheduleNextPruning ( self)
protected

◆ addPrivateObj()

addPrivateObj ( cls,
obj )

◆ destroy()

destroy ( self)

Reimplemented from Job.

◆ getContainerById()

getContainerById ( self,
id )

◆ getContainerByIdGen()

getContainerByIdGen ( self,
id,
** kwArgs )

◆ getContainerIds()

getContainerIds ( self)

◆ getContainerNameById()

getContainerNameById ( self,
id )

◆ getContainerNameByIdGen()

getContainerNameByIdGen ( self,
id,
** kwArgs )

◆ getLeakEvent()

getLeakEvent ( self)

◆ getPathsToContainers()

getPathsToContainers ( self,
name,
ot,
doneCallback = None )

◆ getPathsToContainersNamed()

getPathsToContainersNamed ( self,
name,
on,
doneCallback = None )

◆ removeContainerById()

removeContainerById ( self,
id )

◆ removePrivateObj()

removePrivateObj ( cls,
obj )

◆ run()

run ( self)
This should be overridden with a generator that does the
needful processing.

yield `Job.Continue` when possible/reasonable, and try not to run
longer than the JobManager's timeslice between yields.

When done, yield `Job.Done`.

Reimplemented from Job.

Member Data Documentation

◆ _checkContainersJob

_checkContainersJob
protected

◆ _checkDelayScale

_checkDelayScale
protected

◆ _checkForLeaks

_checkForLeaks
protected

◆ _findContainersJob

_findContainersJob
protected

◆ _id2ref

_id2ref
protected

◆ _index2containerId2len

_index2containerId2len
protected

◆ _index2delay

_index2delay
protected

◆ _nextCheckDelay

_nextCheckDelay
protected

◆ _pruneContainersJob

_pruneContainersJob
protected

◆ _pruneObjectRefs

_pruneObjectRefs
protected

◆ _pruneTaskPeriod

_pruneTaskPeriod
protected

◆ _scheduleNextLeakCheck

_scheduleNextLeakCheck
protected

◆ _scheduleNextPruning

_scheduleNextPruning
protected

◆ _serialNum

_serialNum
protected

◆ notify

notify = directNotify.newCategory("ContainerLeakDetector")
static

◆ PrivateIds

PrivateIds = set()
static