ClassUnloading option

Srinivas Ramakrishna ysr1729 at gmail.com
Sat Jun 9 00:02:17 UTC 2012


Further, each instance holds a reference to its class. Along with the fact
that each class references its loader and that the
loader references all the classes it loaded, we have a strongly connected
component in the object graph whose lifetime
is the same. So, GC will collect the classloader and its classes when the
classloader and all its classes become unreferenced.
i.e. when there are no reachable instances of any of those classes, no
references to the classloader and no reference to
any of the classes.

-- ramki

On Fri, Jun 8, 2012 at 7:34 AM, Ion Ionascu <ionionascu at gmail.com> 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.
>
> 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.
>
>
> Thank you,
> Ion Ionascu
>
> www.ionionascu.eu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20120608/22f11713/attachment.htm>


More information about the hotspot-gc-dev mailing list