On Sat, Oct 11, 2014 at 4:07 AM, Steve Holden <steve at holdenweb.com> wrote: > I found the following code appeared to work without any issues: > > %matplotlib inline > import numpy as np > import matplotlib.pyplot as plt > > import sys > import time > from IPython.display import display, clear_output > > x=np.linspace(0,6,100) > for t in np.linspace(0,20,100): > clear_output(wait=True) > f=plt.figure(figsize=(10,10)) > plt.plot(np.sin(x)*np.sin(t),'-o') > plt.gca().set_ylim([-1,1]) > display(f) > plt.close() > > Further queries should be sent to the python-dev list, as this one is being > phased out. > Running this code makes a working animation, but watching the memory usage of the python2.7 process it is clear there is a memory leak - it starts around 150 M and climbs to 300 M. Running for longer keeps this going. I think the figures are being generated, cleared in the notebook, but still existing somehow in the background. Is there a way to determine if this is happening? Is there a proper way to write the animation to avoid this? thanks! Brian Blais ----------------- bblais at gmail.com http://web.bryant.edu/~bblais
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4