What is the difference between `PermGen` (Java 7) and `Metaspace` (Java 8+)?

Java Professional Hard

Java Professional — Hard

What is the difference between `PermGen` (Java 7) and `Metaspace` (Java 8+)?

Key points

  • PermGen had fixed size; Metaspace grows dynamically
  • PermGen prone to OutOfMemoryError; Metaspace avoids this issue
  • Metaspace stores class metadata in native memory

Ready to go further?

Related questions