-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Eliminate static field references to JRuby state #5143
Comments
Reevaluate for 9.3. |
Reviewing this in advance of 9.3 release.
These all appear to be soft references. They will linger but should not leak in an unbounded way.
This does not seem to be a problem. The map is weak-keyed, so should clear out after a runtime goes away, and uses identity to look up the value, which will isolate calls across runtimes.
Java subclasses are not intended to be usable across runtimes, and should be loading the generated class into our child JRubyClassLoader. @byteit101 may have comments here relating to #6422.
I am not sure which issue is the "leak" mentioned here. Java interface implementations are, like Java subclasses, intended to be used only in the originating JRuby instance, and should be collected with that instance (and its JRubyClassLoader) is expunged.
This is still the case, and I am still unsure if it is safe.
SelectorProvider is loaded in the same classloader as this static CHM and the IOSelector instances should have no links to JRuby's runtime. This code is also deprecated and/or unused now (deprecate remaining references to this logic).
This is no more or less worrisome than other soft referenced threadlocals to JRuby-specific classes. We will deal with leak reports in the future (have had none about this or the other soft threadlocals above).
This is by design. We may want to consider phasing this model out. |
The implementation is safe and the actual caches indices are stored weakly, so I think this is a non-issue.
Still an issue but not a complete or supported feature and not enabled by default. Additional work can clean up static fields. |
Calling this one resolved. Remaining static references are either non-issues or not part of supported/active code. |
We are doing an audit of JRuby and related projects looking for static references to JRuby state, since those references can anchor the JRuby instance, the classloader that loaded JRuby, and more.
I have fixed a number of cases for 9.1 in f248488. I fixed a few additional cases on master (9.2) in 95a41f9.
Here are my notes on other cases that did not have an easy fix...but they may not be problems.
The text was updated successfully, but these errors were encountered: