Thursday 18 May 2017

What is metaspace in Java?

Until Java 7, there was an area in JVM memory called PermGen, where JVM used to keep its classes. In Java 8, Permanent Generation (PermGen) space was completely removed and is 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.

Metaspace by default auto increases its size (up to what the underlying OS provides), while PermGen always has a fixed maximum size. You can set a fixed maximum for Metaspace with JVM parameters, but you cannot make PermGen auto increase.




No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...