Memory overflow using OpenCV Imported with dll

I'm tracking colors using OpenCV library written in c++ imported with DLL. The only thing is that the DLL is starting the camera but I can't make it release the camera without huge latency. Therefore the memory is stacked with unused images from the camera, which after a few minutes crashes.

Is there function or method to clear the memory every minute or somth?

Thx in advance.

I have the same problem! Everytime when I need to release memory i have an error! If i do not use release methods unity crashes in two minutes!