You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the application logic, I need very often to convert Mat to BufferedImage and viсe versa. In order to do this - I use the following functions:
Right now I faced a huge memory leak during the application execution on image processing step where these functions are involved.
So my question is - do I need to manually call MatOfByte.release() in both of these functions(before return statement) in order to try to prevent the memory leak?
And the same question for the objects of the following classes:
Sorry for the long response time on this - yes, you need to call Mat.release() for any Mat you create. OpenCV bundles a finalize method, but these often don't get called, so best practice is to release it yourself.
I use the following OpenCV Java JNA wrapper:
According to the application logic, I need very often to convert
Mat
toBufferedImage
and viсe versa. In order to do this - I use the following functions:Right now I faced a huge memory leak during the application execution on image processing step where these functions are involved.
So my question is - do I need to manually call
MatOfByte.release()
in both of these functions(beforereturn
statement) in order to try to prevent the memory leak?And the same question for the objects of the following classes:
Do I need to manually call
release()
for them also?The text was updated successfully, but these errors were encountered: