New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color init with string: use Color resource management for setup #127

Merged
merged 1 commit into from Aug 4, 2013

Conversation

3 participants
@w-m

w-m commented Jul 24, 2013

When initializing a Color by string, a PixelWand is leaked every time.

This can be easily verified by calling

for i in xrange(5000): orange = wand.color.Color('orange') del orange

and watching the memory footprint of the Python process increase (with any system tool available).

Fix: freeing the PixelWand in init. I thought it might be best to use the resource management that's already in place instead of adding the DestroyPixelWand explicitly.

No test is added, because I don't know about a cross-platform builtin Python module to measure memory.

All provided tests still pass.

@coveralls

This comment has been minimized.

coveralls commented Jul 24, 2013

Coverage Status

Coverage remained the same when pulling 4b0c70b on w-m:0.3-maintenance into 48e80c3 on dahlia:0.3-maintenance.

@dahlia

This comment has been minimized.

Collaborator

dahlia commented Jul 25, 2013

Thanks for the patch. I will review this and try writing a regression test for it in portable way soon. 😄

dahlia added a commit that referenced this pull request Aug 4, 2013

dahlia added a commit that referenced this pull request Aug 4, 2013

dahlia added a commit that referenced this pull request Aug 4, 2013

@dahlia dahlia merged commit 4b0c70b into emcconville:0.3-maintenance Aug 4, 2013

1 check was pending

default The Travis CI build is in progress
Details
@dahlia

This comment has been minimized.

Collaborator

dahlia commented Aug 4, 2013

I wrote a test using memory_profiler and psutil for this patch. See 8928a1e. Anyway it’s merged to 0.3-maintenance branch. Thanks!

dahlia added a commit that referenced this pull request Aug 4, 2013

dahlia added a commit that referenced this pull request Aug 4, 2013

dahlia added a commit that referenced this pull request Aug 4, 2013

At least until 6.6.9-7 IM itself has a memory leak
And Travis CI still use IM 6.6.9-7

#127
@dahlia

This comment has been minimized.

Collaborator

dahlia commented Aug 4, 2013

This is included in the 0.3.3 release. 🍰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment