The Permanent Generation (PermGen) space has completely been removed and is kind of replaced by a new space called Metaspace.The consequences of the PermGen removal is that obviously the PermSize and MaxPermSize JVM arguments are ignored and you will never get a java.lang.OutOfMemoryError
: PermGen error.
The JDK 8 HotSpot JVM is now using native memory for the representation of class metadata and is called Metaspace. Read More>>
PermGen space is replaced by MetaSpace in Java 8. The PermSize and MaxPermSize JVM arguments are ignored and a warning is issued if present at start-up.
Most allocations for the class metadata are now allocated out of native memory. * The classes that were used to describe class metadata have been removed.
Main difference between old PermGen and new MetaSpace is, you don't have to mandatory define upper limit of memory usage. You can keep MetaSpace space limit unbounded. Thus when memory usage increases you will not get OutOfMemoryError error. Instead the reserved native memory is increased to full-fill the increase memory usage.
You can define the max limit of space for MetaSpace, and then it will throw OutOfMemoryError : Metadata space. Thus it is important to define this limit cautiously, so that we can avoid memory waste.
Oracle's JVM implementation for Java 8 got rid of the PermGen model and replaced it with Metaspace.
This is one of the new features of Java 8, part of JDK Enhancement Proposals 122:
Remove the permanent generation from the Hotspot JVM and thus the need to tune the size of the permanent generation.
The list of all the JEPs that will be included in Java 8 can be found on the JDK8 milestones page.
Because the PermGen space was removed. Memory management has changed a bit.
Source: Stackoverflow.com