You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be a memory leak in Chaco when plots are repeatedly updated (example below).
I'm only getting the leak with the qt backend, and only with pyside (not pyqt).
I'm on windows 7 (64-bit) running EPD 7.2-2 (32-bit).
PySide: 1.1.0-2
Chaco: 4.1.0-1
Pyface: 4.1.0-1
We're doing real-time plotting w/ Chaco, and after a few hundred updates the app can easily exceed 2Gb memory usage and crash. I've tried unsuccessfully to figure out where in Chaco this is happening...
Please advise if I can be of assistance in tracking this down. Am I plotting in a non-standard way--is that why other people aren't running into this?
Cheers,
Rob
importosos.environ['QT_API'] ='pyside'#'pyqt' # Only happens with Pysidefromtraits.etsconfig.etsconfigimportETSConfigETSConfig.toolkit='qt4'# Doesn't seem to happen w/ WX backend.importnumpyasnpfromtraits.apiimportHasTraits, Instancefromtraitsui.apiimportView, VGroup, Itemfrompyface.timer.apiimportdo_afterfromenable.apiimportComponent, ComponentEditorfromchaco.apiimportPlot, ArrayPlotDataPERIOD_MS=100DATA_LENGTH=1000classPlotViewer(HasTraits):
""" Example class showing a Pyside memory leak that happens whenever a chaco plot updates... """pd=Instance(ArrayPlotData)
plot=Instance(Plot)
def__init__(self):
self.plot=Plot(self.pd)
self.plot.plot(("x", "y"), type="scatter")
do_after(PERIOD_MS, self._update_pd) # Start plotting loop.def_pd_default(self):
# A random linepd=ArrayPlotData(x=np.arange(DATA_LENGTH),
y=np.random.rand(DATA_LENGTH))
returnpddef_update_pd(self):
''' Change the 'y' data, triggering a plot update, every PERIOD_MS ms. '''self.pd.set_data('y', np.random.rand(DATA_LENGTH))
do_after(PERIOD_MS, self._update_pd) # Continue plotting loop...# View #####################################################################traits_view=View(
VGroup(
Item('plot',editor=ComponentEditor()),
show_labels=False
),
width=500, height=500
)
if__name__=="__main__":
pv=PlotViewer()
pv.configure_traits()
The text was updated successfully, but these errors were encountered:
I'd be happy to help try to fix this, but I'm not sure where to look... I imagine that switching from pyqt->pyside introduced an error that's being silently caught somewhere? Or, perhaps the error is in Pyside?
enthought/enable#42 fixes this issue. Once it is merged you can checkout and use enable. Alternatively if it is urgent you might want to apply the patch yourself to your local version.
There seems to be a memory leak in Chaco when plots are repeatedly updated (example below).
I'm only getting the leak with the qt backend, and only with pyside (not pyqt).
I'm on windows 7 (64-bit) running EPD 7.2-2 (32-bit).
PySide: 1.1.0-2
Chaco: 4.1.0-1
Pyface: 4.1.0-1
We're doing real-time plotting w/ Chaco, and after a few hundred updates the app can easily exceed 2Gb memory usage and crash. I've tried unsuccessfully to figure out where in Chaco this is happening...
Please advise if I can be of assistance in tracking this down. Am I plotting in a non-standard way--is that why other people aren't running into this?
Cheers,
Rob
The text was updated successfully, but these errors were encountered: