0 votes
289 views
in Java by
What is the difference between PermGenSpace and MetaSpace ?

1 Answer

0 votes
by (5k points)
There are following difference between PermGenSpace and MetaSpace :-

PermGen has been completely removed.

Metaspace garbage collection - Garbage collection of the dead classes and classloaders is triggered once the class metadata usage reaches the MaxMetaspaceSize.

The space Metadata was held is no longer contiguous to the Java heap, The metadata has now moved to native memory to an area known as the Metaspace.

Metaspace size auto increases in native memory as required to load class metadata if not restricted with -XX:MaxMetaspaceSize

PermGen means "Permanent Generation" is a special heap space separated from the main memory heap. The JVM keeps loaded class metadata in the PermGen. The JVM stores all the static content in this memory. This includes all the static methods, primitive variables, and references to the static objects.

In JDK 8, Oracle completely removed this memory space. Metaspace is a new memory space – starting from the Java 8 version; it has replaced the older PermGen memory space.

Share:- Whatsapp Facebook Facebook


Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

Categories

...