eclipse-sisu / sisu-project

Sisu Inject
https://www.eclipse.org/sisu
Eclipse Public License 2.0
17 stars 15 forks source link

LifecycleManager reatains classes forever #74

Closed laeubi closed 1 month ago

laeubi commented 1 year ago

The following Map in LifecycleManager https://github.com/eclipse/sisu.inject/blob/6fa4bc1a635f1e8ec91e438bcb059f414d713f70/org.eclipse.sisu.inject/src/org/eclipse/sisu/bean/LifecycleManager.java#L31-L32

prevents no longer used classes (and more important their classloaders) from being garbage collected, see for example

This should use some strategies like WeakHashMap so if the class is only referenced from this component it could still be freed.

See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=581407

odrotbohm commented 1 year ago

Thanks for moving this into the right place, @laeubi! 🙇