[1969] in java-interest

home help back first fref pref prev next nref lref last post

GC and Class management

daemon@ATHENA.MIT.EDU (Steve Yen)
Wed Sep 20 17:47:40 1995

To: java-interest <java-interest@java.sun.com>
From: Steve Yen <Steve_Yen.LOTUS@crd.lotus.com>
Date: 20 Sep 95 11:57:09 EDT

I know java does garbage collection on instances of Object, 
but does java do garbage collection on instances of Class?  

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?  ;-)

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.)

That way I could forcefully unload class X, then reload a new, 
different version of class X.  

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?

Thanks much.  Java is pretty cool.

steve
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post