First time here? Check out the FAQ!

Ask Your Question
0

Using OpenCV in MFC cause memory leak

asked Apr 11 '18

flaviu2 gravatar image

I am using OpenCV into MFC project ... but I noticed something strange: if I only insert

#include <opencv2/opencv.hpp>

then I have a lot of memory leak:

Detected memory leaks!
Dumping objects ->
{27112} normal block at 0x02BA8360, 128 bytes long.
 Data: <                > FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 
{146} normal block at 0x00D35158, 4 bytes long.
 Data: < Q  > 98 51 D3 00 
{145} normal block at 0x00D35098, 125 bytes long.
 Data: <                > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD 
{144} normal block at 0x00D34FE0, 122 bytes long.
 Data: <                > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD 
{143} normal block at 0x00D34F28, 121 bytes long.
 Data: <                > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD 
{142} normal block at 0x00D34E68, 129 bytes long.
 Data: <                > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD 
 Data: <    8L      (   > CD CD CD CD 38 4C D3 00 00 00 00 00 28 00 00 00 
Object dump complete.
The program '[4428] TestOpen.exe: Native' has exited with code 0 (0x0).

and I used no object from OpenCV library ... I have done something wrong ?

Preview: (hide)

Comments

opencv indeed allocates some static buffers for mutexes, random pools, etc, which never are freed (tha's the os'es job) , even if you don't call any code on your own.

nothing to worry about, i'd think.

berak gravatar imageberak (Apr 11 '18)edit

Ok, thank you. It is not first time signaled this issue, I wonder how it doesn't been solved by now ...

flaviu2 gravatar imageflaviu2 (Apr 13 '18)edit

1 answer

Sort by » oldest newest most voted
2

answered Sep 20 '0

Frank Heimes gravatar image

@flaviu2 The leaks haven't been fixed but introduced in 2015 in order to fix crashes upon process exit caused by an undefined order of release of resources.

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Apr 11 '18

Seen: 849 times

Last updated: Apr 11 '18