Memory not released using tkAgg or WXAgg?

I'm new to both Python and matplotlib.

I'm using this on MS Win with Python 2.3 and matplotlib 0.7. and ipython as IDE.

A substantial amount of memory is allocated when a array of constantly varying values is plotted, as example:

# Sawtooth signal 32768 elements long to show memory usage.
y = ones(2**15)
y[1::2] = 0
plot(y)

if the figure created is now killed, the memory is not released, and more memory is allocated each time the plot() command is executed. Thr memory is only returned to the system once python is closed.

Plotting a signal with less amplitude variation or slow amplitude change ( for instance plot(ones2**15) or plot(sin(arange(0,10,10./2**15)) ) uses a lot less memory, so the leak is not as obvious, but still there.

Any suggestions from the group on resolving this?

Thanks,
Hennie