Open shaikhibrahim951 opened 6 years ago
Please share the source code being used. Have you confirmed other components (like camera, opencv, or) do not leak memory as well ?
My camera and opencv is not resposible for memory leak. I checked it. I will share my source code if you find the problem then it will be good.
Attached file is test.cpp in txt form
Thanks
This may be platform specific behaviour. To be on the safe side, I have pushed a long pending patch for a known memory leak (https://github.com/prabindh/darknet/commit/f6f41a1f3a61b801c109ed62643bcfeb891447a9) - please take a look at latest master.
hey, in my case the leak problem is because of the resize function in ArapahoV2::Detect. in every frame it is leaking around 60KB of memory.
@SinghiDivyanshu Which platform (ARM or x64, Windows or Linux) are you seeing this on ?
@prabindh That problem is resolved as i change the width and height in .cfg file so that resize function is not required.
but still their is a 18KB of definite leak per frame and i'm using linux.
18 kB seems small for a 3-ch image frame. Will have to check further.
@prabindh ok thanks for the help.
Do we have a solution for this?
Havent found time to deep debug, but to rule out CV itself, wrote a modified function with separate Mats for each operation. Could you please give it a try and let me know if it helps ?
bool ArapahoV2::Detect( const cv::Mat & inputMat, float thresh, float hier_thresh, int & objectCount)
, with the one in the gist below. https://gist.github.com/prabindh/b7875557e736f75a576972de5618aecf
@ArpitaSTugave In my case main leak (350KB memory) was due to cv::imshow() function for every frame.
@SinghiDivyanshu - What version of OpenCV dll is being used in your cases ?
openCV 3.3
So I think there are 2 issues here:
leak due to resize: I change the width and height in cfg file.
and for imshow() leak: I'm not able to find any solution, so i remove that function.
Hi,
I trained my images with tiny yolo and output is coming good but after 10 to 12 minutes in terminal I am getting
killed
message. I checked my memory usage usingtop
command then I find that available memory getting reduced by some amount and at some point system is getting hanged. I think some memory leak problem is there and program is not clearing that memory after allocation. Note : I am working on NVIDIA TX2 board having 8GB of RAM. Kindly provide some help regarding this issue. Thanks in advance