File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737
3838TIMER_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-
4840class 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...
You can’t perform that action at this time.
0 commit comments