On 14/02/2008, Sahoo <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am a bit surprised to see that classes are not getting unloaded when I
> uninstall my bundle. In my program, I try to force the GC by calling
> Runtime.gc() a couple of times. Looking at the gc log, I do see "Full
> GC" happening. I am using -verbose:gc option to see class unloading
> details. If I run the same program using some other implementation, I
> see classes are getting unloaded. I have verified the same using
> jconsole as well. Am I missing any flag? Is it a known issue?


I just tried a very simple bundle with trunk and see classes unloaded:
( note - I customized shell.tui to force a couple of GCs per command )

==========================================================
-> ps
START LEVEL 1
   ID   State         Level  Name
[Loaded java.util.TreeMap$3 from
/home/stuart/Tools/j2sdk1.4.2_15/jre/lib/rt.jar]
[   0] [Active     ] [    0] System Bundle (1.1.0.SNAPSHOT)
[   1] [Active     ] [    1] Apache Felix Shell Service (1.0.0)
[   2] [Active     ] [    1] Apache Felix Shell TUI (1.1.0.SNAPSHOT)
[   3] [Active     ] [    1] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
-> ps
START LEVEL 1
   ID   State         Level  Name
[   0] [Active     ] [    0] System Bundle (1.1.0.SNAPSHOT)
[   1] [Active     ] [    1] Apache Felix Shell Service (1.0.0)
[   2] [Active     ] [    1] Apache Felix Shell TUI (1.1.0.SNAPSHOT)
[   3] [Active     ] [    1] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
-> install file:/tmp/foo.jar
Bundle ID: 4
-> ps
START LEVEL 1
   ID   State         Level  Name
[   0] [Active     ] [    0] System Bundle (1.1.0.SNAPSHOT)
[   1] [Active     ] [    1] Apache Felix Shell Service (1.0.0)
[   2] [Active     ] [    1] Apache Felix Shell TUI (1.1.0.SNAPSHOT)
[   3] [Active     ] [    1] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
[   4] [Installed  ] [    1] foo (1.0.0.SNAPSHOT)
-> start 4
DEBUG: WIRE: 4.0 -> foo -> 4.0
DEBUG: WIRE: 4.0 -> org.osgi.framework -> 0
[Loaded foo.internal.ExampleActivator]
STARTING foo
REGISTER foo.ExampleService
[Loaded foo.ExampleService]
[Loaded foo.internal.ExampleServiceImpl]
-> ps
START LEVEL 1
   ID   State         Level  Name
[   0] [Active     ] [    0] System Bundle (1.1.0.SNAPSHOT)
[   1] [Active     ] [    1] Apache Felix Shell Service (1.0.0)
[   2] [Active     ] [    1] Apache Felix Shell TUI (1.1.0.SNAPSHOT)
[   3] [Active     ] [    1] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
[   4] [Active     ] [    1] foo (1.0.0.SNAPSHOT)
-> uninstall 4
STOPPING foo
[Loaded org.apache.felix.framework.Felix$RefreshHelper]
[Unloading class foo.internal.ExampleServiceImpl]
[Unloading class foo.ExampleService]
[Unloading class foo.internal.ExampleActivator]
-> ps
START LEVEL 1
   ID   State         Level  Name
[   0] [Active     ] [    0] System Bundle (1.1.0.SNAPSHOT)
[   1] [Active     ] [    1] Apache Felix Shell Service (1.0.0)
[   2] [Active     ] [    1] Apache Felix Shell TUI (1.1.0.SNAPSHOT)
[   3] [Active     ] [    1] Apache Felix Bundle Repository (1.1.0.SNAPSHOT)
->
==========================================================

the foo bundle installs a simple service with the OSGi framework.

if you can provide a simplified testcase that shows a bundle not
unloading, please open a JIRA issue and attach the files needed
to recreate it so we can investigate.

( diagnosing the issue is much faster when we have a testcase )

alternatively, if you want to diagnose it yourself, I'd suggest using
a heap profiling tool to find out what's holding on to your application
classes - and see what's different between other frameworks.

HTH

Thanks,
> Sahoo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
-- 
Cheers, Stuart

Reply via email to