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

Removing finalize from CvMat #18

Open
mgrinshpon opened this issue Jun 15, 2023 · 0 comments
Open

Removing finalize from CvMat #18

mgrinshpon opened this issue Jun 15, 2023 · 0 comments

Comments

@mgrinshpon
Copy link
Collaborator

mgrinshpon commented Jun 15, 2023

JEP-421 slates finalize to be removed and this ticket tracks those removals from the JDK in full. JEP-421 recommends using try-with-resources and/or cleaners and phantomrefs to deal with memory problems. This is an issue to figure out solutions to that upcoming problem.

try-with-resource: we already do that- CvMat adds try-with-resources to OpenCV's mat. Finalize is used as a development aid to track resource leaks. This is a thread to talk about what to do.

I have done almost no work on coming up with a solution but some avenues of approach could be to:

  • investigate JEP-419's foreign memory interface
  • tie the ability of a CvMat to access memory at all into PileCV's closer. This adds a tight coupling but since the alternative is a possible resource leak, maybe that's okay?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant