The method area can also be garbage collected. Because Java programs can be dynamically extended via class loader objects, classes can become "unreferenced" by the application. If a class becomes unreferenced, a Java Virtual Machine can unload the class(garbage collect it) to keep the memory occupied by the method area at a minimum.
Type Information: for each type it loads, a Java Virtual Machine must store the following kinds of information in the method area:
. the fully qualified name of the type
. the fully qualified name of the type's direct superclass
.whether or not the type is a class or an interface
. the type's modifiers(some sumbset of ' public , abstract, final)
.an ordered list of the fully qualified names of any direct superinterfaces.
In addition to basic type information listed above, it must also store for each loaded type:
. the constant pool for the type
. field information
. method information
.all class(static) variables declared in the type, except constants
.a reference to class ClassLoader
. a reference to Class Class