Browse Source

*** empty log message ***

Joe Shochet 21 years ago
parent
commit
f8f1515162
1 changed files with 19 additions and 0 deletions
  1. 19 0
      direct/src/directutil/MemoryLeakHelpers.py

+ 19 - 0
direct/src/directutil/MemoryLeakHelpers.py

@@ -0,0 +1,19 @@
+
+# Documentation
+# http://www.python.org/doc/2.2.3/lib/module-gc.html
+# http://www.python.org/~jeremy/weblog/030410.html
+
+# Before you chase down leaks, make sure you Config:
+# fsm-redefine 0
+# want-dev 0
+
+
+import gc
+gc.set_debug(gc.DEBUG_LEAK)
+gc.collect()
+
+# This will be a list of the uncollectables
+print gc.garbage
+
+# Inside DistributedObjectAI, you can uncomment the __del__ function to
+# see when your objects are being deleted (or not)