Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 411d69a

Browse files
committed
Make memleak_gui.py output loadable via pylab.load()
svn path=/trunk/matplotlib/; revision=3455
1 parent a150bc9 commit 411d69a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

unit/memleak_gui.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
import pylab
4949
import matplotlib.cbook as cbook
5050

51-
print indEnd
52-
51+
print '# columns are: iteration, OS memory (k), number of python objects'
52+
print '#'
5353
for i in range(indEnd+1):
5454

5555
fig = pylab.figure()
@@ -60,13 +60,15 @@
6060
val = cbook.report_memory(i)
6161
if options.verbose:
6262
if i % 10 == 0:
63-
print ("iter: %4d OS memory: %8d Python objects: %8d" %
63+
#print ("iter: %4d OS memory: %8d Python objects: %8d" %
64+
print ("%4d %8d %8d" %
6465
(i, val, len(gc.get_objects())))
6566
if i==indStart: start = val # wait a few cycles for memory usage to stabilize
6667

6768
gc.collect()
6869
end = val
6970

71+
print '# columns above are: iteration, OS memory (k), number of python objects'
7072
print '#'
7173
print '# uncollectable list:', gc.garbage
7274
print '#'

0 commit comments

Comments
 (0)