Extremely high memory leak with OpenCV video capture

Hi,
It seems to be an issue in cv2.VideoCapture(0). Probably you can try to run gstreamer pipeline in cv2.VideoCapture() like:
How to Filesink and Appsink simultaneously in OpenCV Gstreamer. (Gstreamer pipeline included) - #7 by DaneLLL
See if it works in the case.