Memory leak in OpenCV 4.20

Windows 10, Visual Studio 2015, OpenCV 4.20 compiled successfully and got memory leak .

Tried:

  • Use different versions of OpenCV
  • Delay load dll

Code Example:
#include <…opencv2\core.hpp>
cv::Mat mat;

Memory leak Message:
Detected memory leaks!
Dumping objects →
{7183} normal block at 0x00000148263D8480, 16 bytes long.
Data: 78 06 05 7F FE 7F 00 00 00 00 00 00 00 00 00 00
{7182} normal block at 0x00000148263D8110, 16 bytes long.
Data: < > F0 06 05 7F FE 7F 00 00 00 00 00 00 00 00 00 00
{7181} normal block at 0x00000148263D80C0, 16 bytes long.
Data: < > A0 06 05 7F FE 7F 00 00 00 00 00 00 00 00 00 00

that is a very old release.

if you found an issue in 4.2.0, it could have been fixed since then.

please update to latest release and try again.

“leaks” of small or bounded size are not practically considered leaks. you’ve got a case if you can cause arbitrary amounts of leakage (and gigabytes at least).

Thanks for your reply! :slightly_smiling_face:
I’ve also tried version 4.8.0 but still have memory leak issue.

No, you don’t have an issue. Tiny amount of unreleased memory at the exit of any program is normal - the OS will release it… You’d have an issue, it there was a continuous leak during the execution.