Ask Your Question

_Cfunc_GoBytes taking lot of memory and not releasing it. Go profiler screenshot

asked 2019-02-07 10:47:14 -0500

##### System information (version) * OpenCV => 4 * GoCV => 0.18.0 * Operating System / Platform => Raspberry Pi * Compiler => GCC

Detailed description
  1. Installed the OpenCV and GoCV from the source. After I ran the IMEncode to convert a gocv.Mat type to []byte. Over the time the Go Profiling result shows increasing in alloc_space.
Steps to reproduce
  1. Create Go Routine
  2. Calls a method accepts a gocv.Mat type and converts Mat to byte
  3. Do that for 5-10 min and same time run the profiler.
  4. Below is a screen shot from the go profiler

image description

edit retag flag offensive close merge delete


show your code, please. (most likely you forgot to Close() some Mat's there ;)

(and your profiler screenshot is quite useless here)

berak gravatar imageberak ( 2019-02-07 11:07:48 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2019-03-05 13:42:44 -0500

I figured out what is the problem? Forgot to close one Mat :)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-02-07 10:47:14 -0500

Seen: 35 times

Last updated: Feb 07