Memory leak reporting preventing upgrade from 2.* to 3.* of OpenCV

asked 2017-03-30 04:46:39 -0600

ttn gravatar image


I want to upgrade my OpenCV from version 2.4.13 to version 3.2 and have successfully build the new 3.2 version and ported our application too.We are developing mainly on Windows using Visual Studio 2015 and in C++.

Running our application in debug mode now results in a lot of different memory leak reports (I know they are actually not memory leaks, see e.g. link ).

As this seems not to be changed, how do others manage this? I mean, it is normally nice to discover very quickly in debug mode that you have a memory leak in the code, but this check is now obscured due to the many leaks I get reported from OpenCV allocation (just a simple start of our application with a few task made results in something like 80 different leaks getting reported).

I would very much like to keep Visual Studio reporting not de-allocated memory when closing the application in debug mode, but is there a work-around for that?

Thanks in advance, Torben.

edit retag flag offensive close merge delete


Valgrind supports suppression files for known memory leaks, but I don't know whether VS detector has same functionality.

mshabunin gravatar imagemshabunin ( 2017-03-30 10:23:48 -0600 )edit

Hi mshabunin.

Unfortunately the number of reported memory leaks and the time and sequence memory is allocated in OpenCV depends on the use our of application (which order do the user do different operations).

So trying to suppress wellknown memory allocations is quite difficult; just starting our application and dragging in a file and zooming and paning in an image gives around 80 reported memory leaks.


ttn gravatar imagettn ( 2017-04-03 02:41:01 -0600 )edit