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

Skip to content

Commit 8e1d147

Browse files
committed
Removed memory reporting stuff (bound not to work on Windows). - ADS
svn path=/trunk/matplotlib/; revision=396
1 parent 6bea5c5 commit 8e1d147

1 file changed

Lines changed: 0 additions & 22 deletions

File tree

examples/dynamic_image_wxagg.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@
3737

3838
TIMER_ID = wxNewId()
3939

40-
# jdh: use this function, or something similar, when reporting a
41-
# memory leak
42-
def report_memory(i):
43-
pid = os.getpid()
44-
a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines()
45-
print i, ' ', a2[1],
46-
return int(a2[1].split()[0])
47-
4840
class PlotFigure(wxFrame):
4941

5042
def __init__(self):
@@ -72,7 +64,6 @@ def __init__(self):
7264
self.SetSizer(sizer)
7365
self.Fit()
7466
EVT_TIMER(self, TIMER_ID, self.onTimer)
75-
self.cnt = 0
7667

7768
def init_plot_data(self):
7869
# jdh you can add a subplot directly from the fig rather than
@@ -100,19 +91,6 @@ def onTimer(self, evt):
10091
self.im.set_array(z)
10192
self.canvas.draw()
10293
#self.canvas.gui_repaint() # jdh wxagg_draw calls this already
103-
104-
val = report_memory(self.cnt)
105-
if self.cnt==1:
106-
self.start = val # skip cnt=0
107-
self.tstart = time.time()
108-
elif self.cnt==50:
109-
end = val
110-
print 'Average memory consumed per loop: %1.4f\n' % ((end-self.start)/float(self.cnt))
111-
print 'FPS', self.cnt/(time.time() - self.tstart)
112-
sys.exit()
113-
114-
self.cnt += 1
115-
gc.collect()
11694

11795
def onEraseBackground(self, evt):
11896
# this is supposed to prevent redraw flicker on some X servers...

0 commit comments

Comments
 (0)