I am running a django application that includes matplotlib and allows the user to indicate the axis of the graph. This can lead to "Overflow Error: Agg Complexity Exceeded"
When this happens, up to 100 MB of RAM are tied. I usually free this memory with fig.gcf() , plot.close() and gc.collect() , but the memory associated with this error does not seem to be related to the plot object.
Does anyone know how I can free this memory?
Thank.
Here is the code that gives me an Agg complexity error.
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import gc a = np.arange(1000000) b = np.random.randn(1000000) fig = plt.figure(num=1, dpi=100, facecolor='w', edgecolor='w') fig.set_size_inches(10,7) ax = fig.add_subplot(111) ax.plot(a, b) fig.savefig('yourdesktop/random.png')
python matplotlib memory-leaks
sequoia Aug 19 '11 at 18:20 2011-08-19 18:20
source share