Hate to say it, Kresten, but I don't think you'll ever see this--the semantics of unloading classes, except by GC, would need to be worked out and codified someplace before this could happen.
Assume for the moment that we go with a simpler implementation, System.classGC() that takes a Class object and unloads it. (Ignore the complications of ClassLoaders for now.) Suppose... (*) ... there is an instance of that Class still reachable in the system? What should happen? (*) ... this is an abstract class that is inherited by other classes in the system (which may or may not have instances still reachable)? (*) ... you're in the middle of a static method execution call on that class on another Thread? (*) ... another thread is *about* (say, five seconds from now) to make a static method execution call on that class? Reification of classes is its own brand of craziness, but it's actually a simpler topic to consider than outright unloading of classes, IMHO. Ted Neward Java, .NET, XML Services Consulting, Teaching, Speaking, Writing http://www.tedneward.com > -----Original Message----- > From: [email protected] [mailto:jvm- > [EMAIL PROTECTED] On Behalf Of Kresten Krab Thorup > Sent: Monday, January 14, 2008 5:07 AM > To: JVM Languages > Subject: [jvm-l] Re: Ability to force class unloading in JDK 6 Update > 4? > > > I think that the best way to improve this would be to add a new kind > of class loader that would permit unloading classes loaded by it. > That would relieve us from creating a new class loader for every class > that needs to be independently unloaded (such as compiled methods). > > I have experimented in different VMs trying to remove the hard-link > from the class loader to the specific classes by means of reflection, > but it doesn't really work consistently and often kills the VM. > > Kresten > > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.516 / Virus Database: 269.19.2/1222 - Release Date: > 1/13/2008 12:23 PM > No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.2/1222 - Release Date: 1/13/2008 12:23 PM --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---
