gocv icon indicating copy to clipboard operation
gocv copied to clipboard

Can't release memory with gocv.NewMat

Open Wan9xy opened this issue 2 years ago • 3 comments

Description

When i create a new mat, I used gocv.NewMat, defer x.Close and after i merged 4 image channel pointer the empty mat. When i see the profile, the memory can't be released.

Steps to Reproduce

m := gocv.NewMat()
defer m.Close
gocv.Merge(bgChans, &m)

And when i use cv2.MatProfile to check program. the memory can't be release forever

  • Operating System and version:MacOS 12.0.1 / Ubuntu 20.02/ Alpine
  • OpenCV version used: 4.5.5
  • How did you install OpenCV? Docker with gocv.
  • GoCV version used: v0.29.0
  • Go version: 1.17.3

Wan9xy avatar Mar 23 '22 01:03 Wan9xy

Mat.Close() is a function, is defer m.Close just typo, or you are using it like that?

golubaca avatar Apr 03 '22 18:04 golubaca

Mat.Close()是一个函数,defer m.Close只是错字,或者你正在使用它?

I have to record memory address by myself now, because m.Close can't close below the img's space, how can i whole close it

Wan9xy avatar Apr 06 '22 05:04 Wan9xy

me too,are you fix it?

brejce avatar May 20 '22 08:05 brejce