1

I'm loading classes with the standard Java classloader:

ClassLoader loader = new MemoryClassLoader(s.toByteArray());
Class<?> myClass = loader.loadClass(className);

MemoryClassLoader is directly derived from ClassLoader and overrides the findClass()-method:

Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
   return defineClass(name, byteArray, 0, byteArray.length);
}

What I would like to know is if it is needed to unload the loaded class somehow. Is there any unload()-method or something I've to call?

enne87
  • 2,221
  • 8
  • 32
  • 61

1 Answers1

1

You don't have to unload or unallocate your classes. The Garbage Collector (aka GC) does all the unset stuffs for you.

You can find information about GC here http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29

gavard.e
  • 142
  • 11