FastTrackOrg / FastTrack

FastTrack is a cross-platform application designed to track multiple objects in video recording.
https://www.fasttrack.sh
GNU General Public License v3.0
101 stars 17 forks source link

[windows] OpenCV memory leak #48

Closed bgallois closed 2 years ago

bgallois commented 2 years ago

On Windows, tracking analysis will triggered a memory leak that will fill the RAM until [ WARN:0@1134.689] global /build/opencv/modules/videoio/src/cap_ffmpeg.cpp (460) cv_capture_retrieve FFmpeg: Exception is raised: OpenCV(4.5.5-pre) /build/opencv/modules/core/src/alloc.cpp:73: error: (-4:Insufficient memory) Failed to allocate 5864700 bytes in function 'OutOfMemoryError' stop the program.

Each iteration triggered the [ERROR:2@1155.784] global C:\opencv\sources\modules\core\src\ocl.cpp (3753) set OpenCL: Kernel(KF)::set(arg_index=3, flags=258): can't create cl_mem handle for passed UMat buffer (addr=000000c7cf1fe5e0) error.

Requesting UMat image to display using Interactive and Replay doesn't trigger the warning and doesn't lead to a memory leak.

bgallois commented 2 years ago

Fixed with 02bbe59cad5972b81186000a97f2a64c1d973025 by deactivating OpenCL. On Windows, it increases the performance by 55%.