Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Memory leak using copyTo UMat

I am having issues converting a Mat image to a UMat using the copyTo method without introducing a memory leak using the OpenCV 3.0.

I have tried tested the using the two code snippets below trying to trace process memory usage step by step: In both cases the orgFrame is a Mat image already allocated and assiged.

Mat version:

Mat frameMat;
orgFrame.copyTo(frameMat); // Memory allocated
frameMat.release(); // Memory deallocated

UMat version:

UMat frameUMat;
orgFrame.copyTo(frameUMat); // Memory allocated
frameUMat.release(); // Expected Memory deallocated - But Not???

I have tracked the memory usage by usin the Performance Monitor (perfmon) Windows tool monitoring the Process - Working Set – Private value.

Can anybody give me an explanation of why the frameUMat.release is not releasing memory as I expect or is this some kind of memory leak bug in the OpenCV code?