Cannot unload plugin with java records Follow
Answered
Hi,
I have an unloading issue with my dynamic plugin. As soon as the plugin contains any Java record, it cannot be unloaded anymore due to the following classloader leak:
ROOT: Sticky class
java.lang.runtime.ObjectMethods.OBJECT_EQ
java.lang.invoke.DirectMethodHandle.asTypeCache
java.lang.invoke.DirectMethodHandle.type
java.lang.invoke.MethodType.ptypes
java.lang.Class[]
com.example.recorddemo.DemoIndex$IndexData.<loader>
* com.intellij.ide.plugins.cl.PluginClassLoader
The record in this trace is com.example.recorddemo.DemoIndex$IndexData. I've shared an example project to reproduce the issue here: https://github.com/jhonnen/intellij-plugin-record-leak
Heap Dump: Upload id: 2022_10_10_NbwHDtKD8isaWbXrUA1sJZ (file: unload-com.example.record-demo-10.10.2022_10.47.16.hprof)
Is this a known issue? Are there any workarounds (except for replacing the record)?
Please sign in to leave a comment.
Thanks for reporting. Could you please file an issue in https://youtrack.jetbrains.com/issues/IDEA with the link to your repro, mem-dump is not necessary.
For now, please avoid using records.
I've created an issue: https://youtrack.jetbrains.com/issue/IDEA-303747/Cannot-unload-plugin-with-java-records