예제 #1
0
 def Objects(self, typename):
     print "%d instances of type %s. Referrers :-" % ( objgraph.count(typename), typename)
     done = {}
     for r in objgraph.by_type(typename):
         if isinstance(r, list):
             print "%s" % str(r[:min(20, len(r))])
         else:
             print "%s" % str(r)
예제 #2
0
def referents_count(typename):
    print "%d instances of  type %s. Referents :-" % ( objgraph.count(typename), typename)
    done = {}
    for r in objgraph.by_type(typename):
        for o in gc.get_referents(r):
            name = _get_key(o)
            if name != "type" and name != typename and not name in EXCLUDED and not name in done:
                done[name] = True
                count = objgraph.count(name)
                if count > 1:
                    print "   %s  (%d)" % ( name, count )
예제 #3
0
def referrers(typename, max_depth=1):
    print("%d instances of type %s. Referrers :-" %
          (objgraph.count(typename), typename))
    for r in objgraph.by_type(typename):
        _do_referrers(r, 1, max_depth, [])
예제 #4
0
파일: debug.py 프로젝트: FPar/gnome15
def referents(typename, max_depth = 1):
    print "%d instances of  type %s. Referents :-" % ( objgraph.count(typename), typename)
    for r in objgraph.by_type(typename):
        _do_referents(r, 1, max_depth)