So I am just plotting a lot of plots, around 5000, and my RAM is running full. I've searched the site and web and found multiple solutions, such as plt.close
, plt.clf()
and gc.collect()
, but neither help. I do not understand why my memory runs full even though I close all figures. Help would be much appreciated.
Same topic here but w/o a working solution for me: How can I release memory after creating matplotlib figures
y = range(5039*402)
x = np.arange(0,402,1)
for i in xrange(len(data_collection)-1):
plt.figure()
plt.plot(x,y[i*402:402*(i+1)])
plt.savefig('save%i.png'%(i))
plt.close()
Sorry, might be an easy question, but I am new to python