Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia cannot do GC automatically on OpenCV Mat #10

Open
liupgd opened this issue Oct 11, 2021 · 1 comment
Open

Julia cannot do GC automatically on OpenCV Mat #10

liupgd opened this issue Oct 11, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@liupgd
Copy link

liupgd commented Oct 11, 2021

Hi, I used OpenCV.jl to read a video frames. And I found that julia is not able to do GC on data read by OpenCV. There need a mandatory GC.gc() to release those memories, otherwise, there will be a memory leakage.
Is this because that julia 'does not know the cpp memory and julia only saves the pointer of these mats' ? Or is there any bug that julia didn't release OpenCV's memory when julia doing GC?

julia version: 1.6.3
system: windows 10
My code:

vcap = cv.VideoCapture(yourVideoFile)
totalframes = cv.get(vcap, cv.CAP_PROP_FRAME_COUNT)
for i in 1:totalframes
    ret, frame = cv.read(vcap)
end

Run the code, and watch the memory consumption in task manager. The memory increased immediately and never decline.

Thx.

@rakeshksr rakeshksr added the bug Something isn't working label Oct 30, 2024
@rakeshksr
Copy link
Member

Related issue opencv/opencv_contrib#2766.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants