Memory Management Counting

asked 2015-01-09 18:27:08 -0500

MRDaniel gravatar image

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

edit retag flag offensive close merge delete

Comments

I think you should better ask this in a C++ Forum as it is not an OpenCV-specific question.

FooBar gravatar imageFooBar ( 2015-01-10 07:18:30 -0500 )edit