Source Code
197 subscribers
30 photos
3 files
80 links
Download Telegram
#jvm
Metaspace?

Metaspace is a special partition of memory in the Java virtual machine. It is located in the Runtime Data Area and is not part of the heap.

It is used to manage memory for metadata class.

Metadata of a class is a describtion of class fields, methods stored in a special object. Every class has own (meta) Class object.

Metadata class are allocated when classes are loaded. Their lifetime is usually scoped to that of the loading classloader - when a loader gets collected, all class metadata it accumulated are released in bulk. The memory manager does not need to track individual allocations for the purpose of freeing them.

Notes:
- Metaspace by default auto increases its size
- Max size can be set using XX: MetaspaceSize
- Comparatively effective Garbage collection. Deallocate class data concurrently and not during GC pause.
- In versions before Java 8 instead of Metaspace was PermGen Space