[Java Application Performance and Memory Management] Chapter 9 – Metaspace and the PermGen

Published by

on

  • All the static variables and general metadata lives in Metaspace area.
  • All the objects on the Heap that are referenced by the static variables in Metaspace will never be garbage collected.
    • Because the static variable is never gone.
  • Before Java 7, it was called as the PermGen.
    • Sometimes when the PermGen got full, it returned java.lang.OutOfMemoryError: PermGen, which was able to be resolved by setting -XX:PermSize=N and -XX:MaxPermSize=N.
    • However after Java 8, these flags are no longer valid as PermGen is replaced by Metaspace.

Reference

Leave a comment