Class loader specific memory is managed by the virtual machine and is allocated for internal management of each class loader.
This memory consists primarily of the internal data structures used
to store class loader, class, and
method data structures.
This includes method bodies in their various forms like bytecode, direct
threaded code, inlined threaded code, and potentially compiled code
(in the presence of a JIT). It also includes normal and interface
virtual tables.
This memory exhibits precise allocation and release patterns. This memory is allocated at class loading time, and at various preparation, verification, and resolution execution points. This memory differs significantly from stacks and the shared garbage collected heap in that once it is allocated, it must stay at a fixed location, and it is unlikely to be released soon. The Java virtual machine specification allows for potential unloading of all classes of a class loader as a group, if no direct or indirect references to the class loader, its classes, and theirs instances remain. In such a case, and if a virtual machine supports class unloading, all memory used by a class loader and its classes can be released at once.