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

polyglot-kotlin docs still mention KT-27956 #250

Open
seanf opened this issue Oct 12, 2022 · 2 comments
Open

polyglot-kotlin docs still mention KT-27956 #250

seanf opened this issue Oct 12, 2022 · 2 comments

Comments

@seanf
Copy link

seanf commented Oct 12, 2022

The docs for polyglot-kotlin still mention the Kotlin issue KT-27956, but this issue and the follow-up KT-33892 are marked as fixed since Kotlin 1.3.60.

Is the performance impact still present?

@seanf
Copy link
Author

seanf commented Oct 12, 2022

@lion7 @thorntonrp
Am I right in thinking that your changes in #184 probably took care of the performance problem mentioned in the readme for polyglot-kotlin? That PR seems to have eliminated all references to ScriptEngine.

## Known Issues
- Each Kotlin `ScriptEngine` requires a classpath that includes information from Maven's own classpath as well as the
extension's `ClassRealm` (which is a special type of `ClassLoader`). This classpath is used to create an additional
`ClassLoader` for use by the `ScriptEngine` which requires the Maven process to consume more metaspace memory than it
would if the Kotlin `ScriptEngine` were able to obtain the class information it needs from the existing classloader.
This is a limitation of the Kotlin script engine. (See [KT-27956](https://youtrack.jetbrains.com/issue/KT-27956))
While this issue does not appear to have a significant impact on Maven's command-line performance, it does affect the
performance of IntelliJ IDEA's remote Maven server process (as of Build #IU_183.5912.21). The IDE's remote Maven
server appears to create a new `ClassRealm` every time it reimports the Maven model. This in turn causes a new
`ScriptEngine` with its additional `ClassLoader` to be re-created even though these are created as singletons. This
results in the IDE's Maven server process consuming much more metaspace over time than it would otherwise, especially
for multi-module projects.
If you care about this issue, please vote for [KT-27956](https://youtrack.jetbrains.com/issue/KT-27956) under the
Kotlin project so that the Kotlin script engine can get the information it needs from the existing classloader.

@lion7
Copy link
Contributor

lion7 commented Oct 27, 2022

I think you are correct, the performance problem should be gone now that the ScriptEngine is no longer used.
Maybe you could create a PR to remove this known issue? The one thing I'm not sure of, is how to measure that it is indeed gone. I'm hoping 1 of the maintainers has a more solid opinion on this, @mosabua perhaps?

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