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

Database instances not reclaimable by GC #161

Closed
mmimica opened this issue Oct 18, 2021 · 2 comments
Closed

Database instances not reclaimable by GC #161

mmimica opened this issue Oct 18, 2021 · 2 comments

Comments

@mmimica
Copy link
Contributor

mmimica commented Oct 18, 2021

Two linked issues:
NativeDatabase ctor is not invoked when an instances is created by hs_compile_multi, so deallocator is not registered there.

In com.gliwka.hyperscan.wrapper.Database#load(java.io.InputStream, java.io.InputStream), the ctor is called, but the deallocator lambda contains a reference to ṫhis, which makes it non-reclaimable by GC.
this.deallocator(() -> hs_free_database(this));

mmimica pushed a commit to mmimica/hyperscan-java that referenced this issue Oct 18, 2021
@simpleyetawesomeprojects

hello @mmimica , I have a question unrelated to your PR. I'm stuck on a problem and could not solve it. I guess you might have an idea, I have created an issue here gliwka/hyperscan-java-native#29. I would highly appreciate it if you can provide any suggestions on how the issue could be resolved. Thank you in advance and apologies for this unrelated comment.

@mmimica
Copy link
Contributor Author

mmimica commented Jul 5, 2022

Sorry, I'm not up to the task. All I know about javacpp I have learned by looking at your code.

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

2 participants