Hi,
I have noticed a memory leak when using pylab.pcolor. Here is the code,
fa() and fb() do the same thing. The difference is the size of the array
which is passed to pcolor. With a large array pcolor leaks but not with a
small one.
Cheers,
Ben
import numpy as np
import matplotlib
matplotlib.use('Agg')
from matplotlib import pylab
def fa():
""" This function leaks.
"""
a = np.arange(1024**2)
a = a.reshape(1024,1024)
for i in range(1):
pylab.pcolor(a)
pylab.close()
def fb():
"""This function does not leak.
"""
b = np.arange(1024)
b = b.reshape(32,32)
for i in range(1024):
pylab.pcolor(b)
pylab.close()