jdriscoll/django-imagekit — Issue #63: wrapping Image.copy causing a memory leak
Author: ptone
Created: 2011-11-10 06:06:03+00:00
State: open

f570bd0d7f57004550f54702c06fea1226f5be41 changed the way images were opened, and wraps the original copy method with one that tries to preserve extra imagekit related info.

however this results in the image data being retained somehow in memory - I'm not sure exactly how or where.

commenting out this line:

```img.copy = types.MethodType(_wrap_copy(img.copy), img, img.__class__)```

results in a substantially reduced memory footprint

I've created a quick sample app/project to demonstrate this - if you watch the process memory - you can see it climb.

https://github.com/ptone/imagefoobar (note this is using the new Django 1.4/trunk layout)

cc @lettertwo