Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Re: Question for Equinox class loading experts


I sent this response to the spring-osgi list ...

I assume your bundle exports one or more packages which other bundles use.  Also, does your bundle export and import the same package?  The OSGi framework has a lazy approach when it comes to update.  When a bundle is updated if it exports a package which is wired to by another bundle then its classloader must be available for bundles wired to it so they can continue to load classes from the uninstalled bundle.  If the new bundle exports *and* imports the same package then when it resolves it may get wired to the old version of its package in an attempt to keep the class space consistent accross the other bundles which are still wired to your old content.  It is not until PackageAdmin.refreshPackages is called that the old classloader can be freed and the old content of the bundle be fully removed from the framework.

This is what sounds like is occurring in your environment.  If you think something else is going on then it would really help if you could get a testcase with a 2-3 bundles involved that we can use to reproduce the behavior you are seeing.  Thanks.

Tom



Hal Hildebrand <hal.hildebrand@xxxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx

06/28/2007 01:21 PM

Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

To
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
cc
Subject
[equinox-dev] Re: Question for Equinox class loading experts





More from Andy:


I have tried using PackageAdmin.refreshPackages() to force  unlinking and
the Bundle to go away but that seems to be a fairly  destructive operation
which causes havoc for us. What I'm not sure of is whether someone is going
to tell me the behaviour is expected unless you call refreshPackages(). I
can see that it might be, although that's not very useful :(

andy



On 6/28/07 10:41 AM, "Hal Hildebrand" <hal.hildebrand@xxxxxxxxxx> wrote:

> Forwarding this message from Andy Piper, from the Spring/OSGi mailing list.
>
> _____________
>
>
> We are seeing an issue in equinox whereby if we install a bundle,
> uninstall it and install it again the new bundle does _not_ get a new
> classloader if the bundle is leaking memory. I think it works ok if
> the old bundle's classes are all de-referenced, but in a complex
> system that's quite a tall order.
>
> We would expect the installation of a new bundle to _always_ result
> in a new classloader being created, the fact that it isn't seems like
> a bug to us.
> Note that if we use a different name when we install the bundle again
> we _do_ get a new classloader.
>
> Any comments from the equinox experts appreciated!
>
> Thanks
>
> andy


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Back to the top