A new feature to store classes was added in Java 8. In Java 8, there is a place known as MetaSpace where all the classes are kept. MetaSpace has replaced PermGen. The Java Virtual Machine used PermGen to store the classes prior to Java 7. Java 8 substituted MetaSpace for PermGen because MetaSpace is dynamic and has no size restrictions. It can also grow dynamically.