As with everything, stuff can only be garbage collected when there are no more references to it. Native is referenced from a ClassLoader. ClassLoaders are referenced from Classes. Classes are referenced from instances. So, you cannot have any references to any of these things from a bundle, otherwise it won't be able to be garbage collected.

When will it happen? Who knows, it is up to the garbage collector.

Windows is particularly annoying, since it locks its native libraries, which prevents them from being deleted. However, I believe Felix does delete them at least in some cases. If you have a specific case where this isn't working, perhaps you could create a simple test case and attach it to a JIRA issue. This would help a lot in resolving it.

Thanks.

-> richard

On 8/14/09 9:44, Holger Hoffstätte wrote:
Can someone shed a ray of light on when exactly a bundle's classloader is
(supposedly) made eligible for GC? I'm working with native code and while
it is not required to re- or unload my bundle, it would be nice to have a
better grasp of potential lifecycle issues.
Right now felix (on Windows) fails to delete a .dll (since it's still
mapped) and complains when the bundle is uninstalled; equinox seems to
ignore the error and marks the bundle resources for deletion on the next
startup.

Thanks!

Holger



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to