Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Memory Management Counting

Hello,

If i have an OpenCV application which has two users. User 1 can only use say 4Gb of RAM at anyone time and User 2 can only use 2Gb of RAM. What is the best way to manage this?

With OpenCV, we could use the image size and depth to calculate the amount of space needed. However, functions create cv::Mat internally which will contribute toward a user's memory allocation. Is there a way to figure this out ahead of time? Or is there a C++ pattern that can manage this across threads?

The behaviour, ideally, would be to halt until enough memory was available for this task.

Regards