ClassUnloading option

Jon Masamitsu jon.masamitsu at oracle.com
Sat Jun 9 05:36:48 UTC 2012



On 6/8/2012 7:34 AM, Ion Ionascu wrote:
> Hi,
>
>
> Could you please explain how the option ClassUnloading actually works? I
> found it being mentioned on the internet, but I haven't been able to find
> too much documentation about it.

I don't know the precise history of that flag but
I'd guess that it is the hotspot specific flag
that corresponds to

     -Xnoclassgc       disable class garbage collection

> In fact I am curious how class-unloading works from JVM/GC's point of view.
> I am asking this because as far I can see the ClassLoader class has a
> private property *classes* which stores a reference to each loaded class so
> a class should not be unloaded (garbage collected) without its classloader
> being gc-ed first. So, a property like ClassUnloading should only allow the
> unloading of classes which are no longer referenced by their classloader.

Yes, classes are only unloaded if their classloader is dead.

Jon

> Thank you,
> Ion Ionascu
>
> www.ionionascu.eu
>



More information about the hotspot-gc-dev mailing list