This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes class unloading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "class unloading" Watch "class unloading" New topic
Author

class unloading

Ewald Geschwinde
Greenhorn

Joined: Nov 25, 2003
Posts: 3
I have a short question about this topic.
I need to unload classes that are dynamically loaded.
I found many examples where classes are dynamically loaded but not unloaded.
Can anyone point me to a good example or tutorial about this topic?
shankar vembu
Ranch Hand

Joined: May 10, 2001
Posts: 309
i never came across a situation where I had to unload classes. And is there a way to do it? I am not sure..... And what makes you to unload the classes? Can you be specific abt your requirement? maybe there is a workaround...
shankar
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

To unload a class, first you have to load the class using a ClassLoader you created -- i.e., not the built-in one. Then to unload a class, make sure there are no instances of the class that are reachable, and then dispose of that ClassLoader. The class itself is now eligible for garbage collection.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: class unloading
 
Similar Threads
RMI conformance
Basic Question
java 5 :Class Data sharing CDS
Restrictions on RMI - what does that mean to me?
class loader ???