示例#1
0
文件: memdebug.py 项目: 1012/scrapy
 def engine_stopped(self):
     gc.collect()
     self.stats.set_value('memdebug/gc_garbage_count', len(gc.garbage))
     for cls, wdict in live_refs.iteritems():
         if not wdict:
             continue
         self.stats.set_value('memdebug/live_refs/%s' % cls.__name__, len(wdict))
示例#2
0
 def spider_closed(self, spider, reason):
     gc.collect()
     self.stats.set_value('memdebug/gc_garbage_count', len(gc.garbage), spider=spider)
     for cls, wdict in live_refs.iteritems():
         if not wdict:
             continue
         self.stats.set_value('memdebug/live_refs/%s' % cls.__name__, len(wdict), spider=spider)
示例#3
0
 def engine_stopped(self):
     gc.collect()
     self.stats.set_value('memdebug/gc_garbage_count', len(gc.garbage))
     for cls, wdict in live_refs.iteritems():
         if not wdict:
             continue
         self.stats.set_value('memdebug/live_refs/%s' % cls.__name__,
                              len(wdict))
示例#4
0
 def engine_stopped(self):
     if self.libxml2:
         self.libxml2.cleanupParser()
         self.stats.set_value('memdebug/libxml2_leaked_bytes', self.libxml2.debugMemory(1))
     gc.collect()
     self.stats.set_value('memdebug/gc_garbage_count', len(gc.garbage))
     for cls, wdict in live_refs.iteritems():
         if not wdict:
             continue
         self.stats.set_value('memdebug/live_refs/%s' % cls.__name__, len(wdict))
示例#5
0
 def engine_stopped(self):
     if self.libxml2:
         self.libxml2.cleanupParser()
         self.stats.set_value('memdebug/libxml2_leaked_bytes', self.libxml2.debugMemory(1))
     gc.collect()
     self.stats.set_value('memdebug/gc_garbage_count', len(gc.garbage))
     if self.trackrefs:
         for cls, wdict in live_refs.iteritems():
             if not wdict:
                 continue
             self.stats.set_value('memdebug/live_refs/%s' % cls.__name__, len(wdict))