Metaspace is JVM-managed native memory that stores class metadata required while a Java application runs. VisualVM exposes its allocation separately from ordinary heap usage. section 5.2.3
Investigate metaspace when:
- The application reports an OutOfMemoryError related to metaspace. section 5.2.3
- Memory allocation grows unexpectedly while frameworks or libraries use Java reflection, dynamic proxies, or indirect calls. section 5.2.3
- A persistence process misuses Hibernate by loading too many database records into one context. section 5.2.3
A metaspace investigation
Open VisualVM’s memory allocation widget and inspect the Metaspace tab. If usage continues to rise, examine reflection-heavy frameworks and scheduled database processing rather than treating a larger Java heap as the root-cause fix. section 5.2.3
