PermGen is the memory area for storing class data like static variable,byte code and etc. By default 64 Mb is allocated for PermGen. It can be tuned by using -XXMaxPermSize.
In Java 8, PermGen method area replaced with MetaSpace. They have moved permGem to the separate memory in the native OS and that is called MetaSpace. It can by default auto increases its size. In MetaSpace, classes can load and unload during the lifespan of the JVM.
Sr. No. | Key | PermGen | MetaSpace |
---|---|---|---|
1 | Basic | PermGen is the memory area for storing class data like static variable,byte code and etc | In Java 8, PermGen method area replaced with MetaSpace |
2 | Default Memory Allocation | By default 64 Mb is allocated for PermGen | It can by default auto increases its size |
3 | Tuned-up Memory Flag | It can be tuned by using -XXMaxPermSize. | We can restrict upper bound of the memory by -XX:MaxMetaspaceSize |
4 | Memory Area | It is a special Heap space. | Since Java 8, It is now separate memory area in the native OS |