> As soon as a bundle accesses resources of another bundle these classes are
> instantiated. A bundle that is uninstalled can only be completely purged
> once the last class of that bundle is garbage collected.

Which can only happen when there are no longer any references to any
instance of any class in the bundle, and no references to the bundle class
loader itself. (Just for the sake of completeness).

> Refreshing the bundles that used the uninstalled bundle normally fix this
> but you also need to make sure the other bundles are cleaning up
> correctly.
> So for example if a bundle starts a thread at some point and this thread
> is
> not stopped on shutdown of the bundle then all classes used in the thread
> will not be cleaned up. So if the thread uses classes of the now
> uninstalled bundle they will remain loaded. This also prevents the
> classloader of the uninstalled bundle to be garbage collected.

This is one common source of problems; another is where bundle A retains a
reference to an instance of a class defined in B, for example as the
result of calling a method in B. So long as this reference is not
overwritten, bundle B cannot be garbage-collected.

Chris

> Christian
>
> 2016-11-11 5:35 GMT+01:00 <manoj.vrajam...@wipro.com>:
>
>> Hi All,
>>
>>
>>
>> I am on Enroute/Eclipse/Bndtools. I INSTALL a certain bundle and then go
>> on to UNINSTALL. But still, the bundle seem to exist (may be in the
>> cache)
>> as I am able to execute functions in this uninstalled bundle.  How do I
>> eliminate this bundle’s presence completely?
>>
>>
>>
>> Thanks,
>>
>> Manoj
>> The information contained in this electronic message and any attachments
>> to this message are intended for the exclusive use of the addressee(s)
>> and
>> may contain proprietary, confidential or privileged information. If you
>> are
>> not the intended recipient, you should not disseminate, distribute or
>> copy
>> this e-mail. Please notify the sender immediately and destroy all copies
>> of
>> this message and any attachments. WARNING: Computer viruses can be
>> transmitted via email. The recipient should check this email and any
>> attachments for the presence of viruses. The company accepts no
>> liability
>> for any damage caused by any virus transmitted by this email.
>> www.wipro.com
>>
>> _______________________________________________
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>
> Open Source Architect
> http://www.talend.com
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev


_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to