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

Public Member Functions

 __init__ (self, name, log=True, verbose=False, fullReport=False, findCycles=True, threaded=False, doneCallback=None, autoDestroy=False, priority=None, safeMode=False, delOnly=False, collect=True)
 
 destroy (self)
 
 finished (self)
 
 getDesc2numDict (self)
 
 getGarbage (self)
 
 getNumCycles (self)
 
 getReport (self)
 
 run (self)
 
- Public Member Functions inherited from Job
 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)
 

Public Attributes

 cycleIds
 
 cycles
 
 cyclesBySyntax
 
 garbage
 
 garbageInstanceIds
 
 numCycles
 
 numGarbage
 
 numGarbageInstances
 
 referentsByNumber
 
 referentsByReference
 
 referrersByNumber
 
 referrersByReference
 
 uniqueCycleSets
 

Static Public Attributes

 notify = directNotify.newCategory("GarbageReport")
 
- 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

 _getCycles (self, index, uniqueCycleSets=None)
 
 _getNormalizedCycle (self, cycle)
 
 _getReferents (self, obj)
 
 _getReferrers (self, obj)
 
- 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

 _args
 
 _id2garbageInfo
 
 _id2index
 
 _report
 
 _reportStr
 
- 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

Detects leaked Python objects (via gc.collect()) and reports on garbage
items, garbage-to-garbage references, and garbage cycles.
If you just want to dump the report to the log, use GarbageLogger.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
name,
log = True,
verbose = False,
fullReport = False,
findCycles = True,
threaded = False,
doneCallback = None,
autoDestroy = False,
priority = None,
safeMode = False,
delOnly = False,
collect = True )

Reimplemented from Job.

Reimplemented in GarbageLogger.

Member Function Documentation

◆ _getCycles()

_getCycles ( self,
index,
uniqueCycleSets = None )
protected

◆ _getNormalizedCycle()

_getNormalizedCycle ( self,
cycle )
protected

◆ _getReferents()

_getReferents ( self,
obj )
protected

◆ _getReferrers()

_getReferrers ( self,
obj )
protected

◆ destroy()

destroy ( self)

Reimplemented from Job.

◆ finished()

finished ( self)

Reimplemented from Job.

◆ getDesc2numDict()

getDesc2numDict ( self)

◆ getGarbage()

getGarbage ( self)

◆ getNumCycles()

getNumCycles ( self)

◆ getReport()

getReport ( self)

◆ 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

◆ _args

_args
protected

◆ _id2garbageInfo

_id2garbageInfo
protected

◆ _id2index

_id2index
protected

◆ _report

_report
protected

◆ _reportStr

_reportStr
protected

◆ cycleIds

cycleIds

◆ cycles

cycles

◆ cyclesBySyntax

cyclesBySyntax

◆ garbage

garbage

◆ garbageInstanceIds

garbageInstanceIds

◆ notify

notify = directNotify.newCategory("GarbageReport")
static

◆ numCycles

numCycles

◆ numGarbage

numGarbage

◆ numGarbageInstances

numGarbageInstances

◆ referentsByNumber

referentsByNumber

◆ referentsByReference

referentsByReference

◆ referrersByNumber

referrersByNumber

◆ referrersByReference

referrersByReference

◆ uniqueCycleSets

uniqueCycleSets