File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434parser .add_option ("-d" , "--backend" , dest = "backend" ,
3535 default = '' ,
3636 help = "backend" )
37-
37+ parser .add_option ("-c" , "--cycles" , dest = "cycles" ,
38+ default = False , action = "store_true" )
3839
3940options , args = parser .parse_args ()
4041
4748import pylab
4849import matplotlib .cbook as cbook
4950
51+ print indEnd
52+
5053for i in range (indEnd + 1 ):
5154
5255 fig = pylab .figure ()
5760 val = cbook .report_memory (i )
5861 if options .verbose :
5962 if i % 10 == 0 :
60- print i , val
63+ print ("iter: %4d OS memory: %8d Python objects: %8d" %
64+ (i , val , len (gc .get_objects ())))
6165 if i == indStart : start = val # wait a few cycles for memory usage to stabilize
6266
6367gc .collect ()
7377 print '# Memory went from %dk to %dk' % (start , end )
7478 print '# Average memory consumed per loop: %1.4fk bytes\n ' % ((end - start )/ float (indEnd - indStart ))
7579
80+ if options .cycles :
81+ cbook .print_cycles (gc .garbage )
You can’t perform that action at this time.
0 commit comments