[2143] in java-interest
Re: GC and Class management
daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Tue Sep 26 03:01:35 1995
Date: Mon, 25 Sep 1995 09:50:30 -0800 (PDT)
From: Arthur van Hoff <Arthur.Vanhoff@Eng.Sun.COM>
Reply-To: Arthur van Hoff <Arthur.Vanhoff@Eng.Sun.COM>
To: Steve Yen <Steve_Yen.LOTUS@crd.lotus.com>
Cc: java-interest@java.Eng.Sun.COM
Hi Steve,
> I know java does garbage collection on instances of Object,
> but does java do garbage collection on instances of Class?
Not yet. We need to do some work in the virtual machine to
make that possible. It is on our list.
> I'm imagining a case where I've been surfing with HotJava
> for several hours, and the java interpreter gets chock full of
> old, no-longer-used applet classes from previous pages.
> Could be a memory resource hog? Or a feature? ;-)
You can consider that a bug.
> A related question...
>
> Is there anyway I can force java to GC or unload an instance of Class
> when there are no more instances of that instance of Class?
> (Sorry for that twister. Hopefully, the question is unambiguous.)
No.
> That way I could forcefully unload class X, then reload a new,
> different version of class X.
No. Reload works in HotJava by loading a new X and using it instead
the old one stays around.
> I didn't see anything in the ClassLoader api. Maybe there's a way
> that I can write some native methods to pull off that trick? Or, can I
> just use ClassLoader to load the new class X over the old class X?
We need to fix the VM first.
> Thanks much. Java is pretty cool.
Thanks.
Have fun,
Arthur van Hoff
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com