MemoryLeakHelpers.py 470 B

1234567891011121314151617
  1. # Documentation
  2. # http://www.python.org/doc/2.2.3/lib/module-gc.html
  3. # http://www.python.org/~jeremy/weblog/030410.html
  4. # Before you chase down leaks, make sure you Config:
  5. # want-dev 0
  6. # You may also want to run pyo-shell so __debug__ is False and assert code is removed.
  7. import gc
  8. gc.set_debug(gc.DEBUG_LEAK)
  9. gc.collect()
  10. print(gc.garbage)
  11. # Inside DistributedObjectAI, you can uncomment the __del__ function to
  12. # see when your objects are being deleted (or not)