Why does my app memory usage is going up when I just take and show new images from camera using opencv in pyqt?

Hi, I’m trying to get live image from camera and update it and show in pyqt but its memory usage goes up while I just use same variable for new frames, is there anything making this consuming more memory every new frame arrives in pyqt or python? it doesn’t consume memory like this without pyqt gui

Hey there!!
Even if you are using the same variable, make sure to release references to old frames. Try replacing the old image with the new one instead of creating new instances. Also, consider slowing down the frame capture rate to help reduce memory usage. If you need more help, feel free to share your code!

1 Like