astropy/astropy — pull request #2754 by mdboom (2014-07-16 15:14:13+00:00)
Title: WCS memory leak

The following program leaks memory:

from astropy.wcs import WCS
w = WCS()
while True:
w.deepcopy()

It also leaks for `.copy()`.

I use a numpy array subclass with an attached WCS object, and this mechanism makes those arrays leak memory whenever a copy/slice/whatever is done on those arrays. It's only a small amount of memory each time, so I didn't notice for a while, but today I encountered a situation where it kills my programs after running for just a few minutes. So this is a serious issue to me.