Skip to content

KT-72172 Dispose URLClassLoader after compilation#5372

Merged
Brian Norman (bnorm) merged 1 commit into
JetBrains:rr/bnorm/KT-72540-close-plugin-classloaderfrom
pablobaxter:master
Nov 7, 2024
Merged

KT-72172 Dispose URLClassLoader after compilation#5372
Brian Norman (bnorm) merged 1 commit into
JetBrains:rr/bnorm/KT-72540-close-plugin-classloaderfrom
pablobaxter:master

Conversation

@pablobaxter

@pablobaxter Pablo Baxter (pablobaxter) commented Oct 23, 2024

Copy link
Copy Markdown
Contributor

Closes URLClassLoader objects upon compilation completion.

See: https://youtrack.jetbrains.com/issue/KT-72172/File-Leak-occurring-in-Kotlin-Daemon

Closes `URLClassLoader` objects upon compilation completion.
@pablobaxter

Copy link
Copy Markdown
Contributor Author

Something that laszio (@ting-yuan) mentioned, this issue can have a negative impact on Windows users due to this:

Closing a URLClassLoader

However, since it can't be predicted exactly when finalization and garbage collection will occur, problems are caused for applications which need to be able to do this in a predictable and timely fashion. It is a problem on Windows, because open files cannot be deleted or replaced.

@bnorm Brian Norman (bnorm) changed the base branch from master to rr/bnorm/KT-72540-close-plugin-classloader November 7, 2024 13:36
@bnorm

Copy link
Copy Markdown
Member

Unfortunately, as it currently exists, this PR is a little incomplete. There are a couple of compiler errors due to the signature change in PluginCliParser. But this is a problem we have also been wanting to fix. So I'm going to retarget your code to a branch of my own and build on your solution to finish it out. Thank you for kick-starting this work!

@bnorm Brian Norman (bnorm) merged commit 66188a3 into JetBrains:rr/bnorm/KT-72540-close-plugin-classloader Nov 7, 2024
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

Successfully merging this pull request may close these issues.

2 participants