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?