Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

How to free memory allocated by UMat?

$
0
0
Hi, I need to free memory allocated by UMat during code execution, so I don't have an out of memory error. I'm using OpenCV 3.1.0 with CUDA 7.5. Here's what I've tried: cv::cuda::DeviceInfo di; size_t totalMemory; size_t freeMemory; di.queryMemory(totalMemory, freeMemory); cout << freeMemory/1024/1024 << endl; UMat m = UMat::zeros(1000,1000, CV_8SC1); di.queryMemory(totalMemory, freeMemory); cout << freeMemory/1024/1024 << endl; m.release(); di.queryMemory(totalMemory, freeMemory); cout << freeMemory/1024/1024 << endl; return 0; Output: 1527 1497 1498

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>