felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: class not getting unloaded when bundle is uninstalled
Date Sat, 01 Mar 2008 23:46:08 GMT
Stuart McCulloch wrote:
> On 29/02/2008, Richard S. Hall <heavy@ungoverned.org> wrote:
>   
>> As a follow up on this issue, Sahoo sent me his test case and it
>> definitely appears that it does not garbage collect as quickly when
>> using auto-start to start install his bundles than in the case where it
>> doesn't, while nulling the local variable from his patch does speed the
>> process.
>>
>> Given that Sahoo has discovered that GC eventually happens, what should
>> we do about this issue? Just leave it or should we apply the patch even
>> though it doesn't really make sense?
>>     
>
>
> well, it makes some sense in that without the patch, this method is holding
> onto bundle references longer than it strictly needs to - and in cases where
> the method takes a long time to return (depending on the various start/stop
> methods called) then it would be beneficial.
>
> so personally speaking, I'd apply the patch - just as a 'hint' to GC
>   

Done...

-> richard

> -> richard
>   
>> Sahoo wrote:
>>     
>>> Karl Pauls wrote:
>>>       
>>>>>  In my test case, the framework is responsible for starting the
>>>>>           
>> bundles
>>     
>>>>>  (I use autostart property to start the bundles). Could it be the
>>>>> problem?
>>>>>
>>>>>           
>>>> I don't think so. In the case mentioned above about 50 bundles are
>>>> installed using the autostart property and I see classes being
>>>> unloaded from the bundles in question.
>>>>
>>>> regards,
>>>>
>>>> Karl
>>>>
>>>>         
>>> Our scenarios are likely to be different. In my case, the autostart
>>> property is making the difference. I can clearly see it when I run my
>>> test case in two configurations as described below:
>>>
>>> Case 1. I use autostart property to install only the test bundle. In
>>> its Activator.start(), the test bundle installs, starts, stops, and
>>> uninstalls another bundle called foo. After foo is uninstalled, I
>>> force gc to happen. This happens as part of Activator.start() and I
>>> see classes from foo bundle getting garbage collected.
>>>
>>> Case 2. I use autostart property to install both the test bundle as
>>> well as aforementioned foo bundle. In its Activator.start(), the test
>>> bundle stops and uninstalls foo bundle. After foo is uninstalled, I
>>> force gc to happen. This happens as part of Activator.start(). In this
>>> case, I don't see class from foo bundle getting garbage collected.
>>>
>>> I later on figured out the reason for this as well. The attached patch
>>> solves the issue.
>>>
>>> Thanks,
>>> Sahoo
>>>
>>>       
>>> ------------------------------------------------------------------------
>>>       
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>       
>
>
>
>   

Mime
View raw message