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:

## 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
| __init__ (self, name)
| 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
| __init__ (self)
| 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 = None
| _checkDelayScale = config.GetFloat('leak-detector-check-delay-scale', 1.5)
| _checkForLeaks
| _findContainersJob = None
dict | _id2ref = {}
dict | _index2containerId2len = {}
dict | _index2delay = {}
int | _nextCheckDelay = firstCheckDelay/2.
| _pruneContainersJob = None
| _pruneObjectRefs
| _pruneTaskPeriod = config.GetFloat('leak-detector-prune-period', 60. * 30.)
| _scheduleNextLeakCheck
| _scheduleNextPruning
| _serialNum = serialNum()
Protected Attributes inherited from Job
bool | _finished = False
| _generator = None
| _id = Job._SerialGen.next()
| _name = name
bool | _printing = False
| _priority = Job.Priorities.Normal
| _pstats = PStatCollector("App:Show code:jobManager:%s" % self._name)
Protected Attributes inherited from DirectObject
dict | _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 )

## 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 = None
| protected

## ◆ _checkDelayScale

_checkDelayScale = config.GetFloat('leak-detector-check-delay-scale', 1.5)
| protected

## ◆ _checkForLeaks

_checkForLeaks
| protected

## ◆ _findContainersJob

_findContainersJob = None
| protected

## ◆ _id2ref

dict _id2ref = {}
| protected

## ◆ _index2containerId2len

_index2containerId2len = {}
| protected

## ◆ _index2delay

dict _index2delay = {}
| protected

## ◆ _nextCheckDelay

_nextCheckDelay = firstCheckDelay/2.
| protected

## ◆ _pruneContainersJob

_pruneContainersJob = None
| protected

## ◆ _pruneObjectRefs

_pruneObjectRefs
| protected

## ◆ _pruneTaskPeriod

_pruneTaskPeriod = config.GetFloat('leak-detector-prune-period', 60. * 30.)
| protected

## ◆ _scheduleNextLeakCheck

_scheduleNextLeakCheck
| protected

Initial value:
= CheckContainers(
'%s-checkForLeaks' % self.getJobName(), self, len(self._index2containerId2len))

## ◆ _scheduleNextPruning

_scheduleNextPruning
| protected

Initial value:
= PruneObjectRefs(
'%s-pruneObjectRefs' % self.getJobName(), self)

## ◆ _serialNum

_serialNum = serialNum()
| protected

## ◆ notify

notify = directNotify.newCategory("ContainerLeakDetector")
| static

## ◆ PrivateIds

PrivateIds = set()
| static