Skip to content
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

Camera.capture() has a memory leak issue #26

Open
define-private-public opened this issue Jun 29, 2017 · 4 comments
Open

Camera.capture() has a memory leak issue #26

define-private-public opened this issue Jun 29, 2017 · 4 comments

Comments

@define-private-public
Copy link
Contributor

This is related to some of my comments near the bottom of #21, specifically this post:
#21 (comment)

After the "fix," I mentioned i suspected that the capture() method of Camera might also have a memory leak. Here is the code that I ran:

import gphoto2cffi as gp

# Get the camera
cam = gp.Camera()

# Infinite loop
while True:
    _ = cam.capture()

I ran that code for about 15 minutes. My my system's RAM usage for that program jumped from 0.1% to 0.4% for that process. While that is very tiny it could cause a lot of problems for anyone who wants to do tethered capturing over a very long period of time.

I'm looking at a fix like the one that I linked above, I'll try to get a pull request to you tomorrow that fixes both.

@multiholle
Copy link

Was this fixed here? #27

@define-private-public
Copy link
Contributor Author

Not fully unfortunately. The one regarding get_preview() was, but this one with capture() has been slightly trickier to track down. As stated in the above comment, it is a very tiny memory leak, and would only impact people who want to do capturing over a very long period of time.

@multiholle
Copy link

I'm building a photobooth for my wedding. The preview would be good for the people to position themselves. I was planning to keep the preview running. I have to check if I run into problems.

@define-private-public
Copy link
Contributor Author

Preview should be fine. If you look at my linked issue, there should be a sample Qt app in it that shows the preview. Try that out and see if you get any memory leaks from it.

Memory leaks may arise from the use of capture(), but they are stupidly tiny.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants