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

memory leak on QtGui.QLabel.setPixmap #144

Closed
hexxter opened this issue May 4, 2016 · 5 comments
Closed

memory leak on QtGui.QLabel.setPixmap #144

hexxter opened this issue May 4, 2016 · 5 comments

Comments

@hexxter
Copy link

hexxter commented May 4, 2016

Hi,

i grep frames from an webcam and display it on a QLabel and it works, but i see an memory leak.

class CameraDisplay(QtGui.QLabel):
    def __init__(self):
        super(CameraDisplay, self).__init__()

    def updateFrame(self, image):
        pm = QtGui.QPixmap.fromImage(image)
        self.setPixmap(pm)

del pm after set has nothing fixed, clear the pixmap cache has not fixed it....

i found this posting and it shows my problem: http://www.mzan.com/article/36663774-qimage-memory-leak.shtml

Info:
Python3.4.3 virtualenv
host: ubuntu 14.04 64bit

@techtonik
Copy link

How do you track leaking memory?

@hexxter
Copy link
Author

hexxter commented May 5, 2016

Am 05.05.2016 um 05:11 schrieb anatoly techtonik:

How do you track leaking memory?


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#144 (comment)

Hi,

it was not so easy i reduced the code and i see it by only comment out
one line. But the setPixelmap was wrong i found it on:

#145

i postet my short testprogram. if you comment "image =
QtGui.QImage(data, size[0], size[1], QtGui.QImage.Format_ARGB32)" out
top shows a normal memory usage.
But with this it you see the leak.

BR Alexander

@techtonik
Copy link

I see. I thought you were using some automated tool like https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer

@mutenroshi2
Copy link

pm = qimage2ndarray.array2qimage(image) #Solution for the memory leak

@techtonik
Copy link

@Ragu25 it is tracked in #145

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

3 participants