Conversation
headius
approved these changes
Sep 26, 2019
Member
headius
left a comment
There was a problem hiding this comment.
This all seems good to me!
I don't know what to say about eval methods; in order for them to be a problem, they'd have to:
- Be continually generated at runtime. This is very uncommon.
- Be called enough to JIT. This seems unlikely now and even more unlikely with our time-based threshold changes.
On the flip side, many methods get generated using eval in a "safe" way (only once, usually to lazily metaprogram some methods) and we definitely want those to be eligible for JIT without a whole separate classloader (when running in a shared mode).
I think we go with this for now as-is. Folks that opt into shared classloading can help us uncover any weird eval edge cases.
enebo
approved these changes
Sep 26, 2019
either for every JIT-ed class or based on source file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
introduces a
-Xjit.loader.modewhich is either UNIQUE (default), SHARED or SHARED_SOURCEmost of it is making
WeakValueMapimplementMapas I originally did something else here ...so I've kept that code and just did a fake
Mapfor the single (shared) global class-loader.that can be changed as needed to a cleaner (proper oop) way.
the SHARED_SOURCE was so far only tested with jruby's test suite, the JITed class-loader count went down to 10% ... and meta-space was much less fragmented - saving around 8% of allocated space.
was not sure whether we should attempt to somehow detect
eval-ed piecesand not share them with the same source file but rather always on their own?
given that SHARED_SOURCE isn't changed to be the new default, we can also decide later.
also if you have suggestions for better naming the option or the enum values.