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
KMeansClustering cause thread leak #4766
Comments
I recently stumbled across this too. The issue is in I would be happy to help provide a PR to solve this if the maintainers give me some direction as to how this should be resolved. the jdk attempts to implement a finalizer in If you wanted to rely on garbage collection I see two possible options:
I personally don't like depending on finalizers. My personal preference (though potentially unpopular) would be to have people supply an If you are willing to depend on threadly, if an executor is not provided using a threadly executor can provide the ability to fall back to garbage collection for releasing the created threads. |
I guess after looking at |
@jentfoo Thanks for the input! Using threadly looks like a good technical solution, but I think the Mozilla license is a problem, @agibsonccc ? |
We follow apache legal guidelines: https://www.apache.org/legal/resolved.html It doesn't appear to conflict with the EPL, I'd be ok with this in that case. |
@agibsonccc and @saudet Thanks for taking a look. One of the primary reasons for choosing MPL 2.0 was its compatibility with other licenses. It seemed like a license that would be a nice fit for a library like threadly. I want anyone who wants to be able to use threadly, my only reason for not using apache is I want development on the project to remain open source and encourage modifications needed to be merged to the upstream project if possible. So in short, I don't see any reason it should be a problem either. I was going to provide a PR for #4781 as well, so if you wanted I could include adding threadly and any other concurrency cleanup things I might notice (all open for discussion of course, but to give us a starting point for that discussion). |
Yes sounds good, go ahead with the PR, thanks!
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue Description
i use KMeansClustering like KMeansTest.java
every client request, i get new kmeans object by KMeansClustering.setup()
but there is no way to destroy threads allocate by KMeansClustering
after thousands or more request, too many threads cause crash
Version Information
The text was updated successfully, but these errors were encountered: