Ask Your Question
0

Using OpenCV in MFC cause memory leak

asked 2018-04-11 06:38:18 -0600

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 ?

edit retag flag offensive close merge delete

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 ( 2018-04-11 09:12:13 -0600 )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 ( 2018-04-13 03:20:53 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2020-09-20 04:11:23 -0600

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-04-11 06:38:18 -0600

Seen: 821 times

Last updated: Apr 11 '18