My Oracle Support Banner

Java SE Permanent Generation or Metaspace Gets Filled with sun.reflect.Generated*Accessor Classes (Doc ID 1669883.1)

Last updated on NOVEMBER 12, 2023

Applies to:

Java SE JDK and JRE - Version 5 to 8
Information in this document applies to any platform.

Symptoms

Applications or frameworks that frequently use the Reflection API can generate numerous Reflection Accessor classes. For example:

sun.reflect.GeneratedMethodAccessor<Number>
sun.reflect.GeneratedConstructorAccessor<Number>
sun.reflect.GeneratedSerializationConstructorAccessor<Number>

As is the case for all loaded classes, the JVM allocates memory for these dynamically generated classes from the JVM-managed memory pool that holds classes and their metadata (class memory pool). In JDK 7, this memory pool is called the "Permanent Generation" or "PermGen" for short. In JDK 8, it is called the "Metaspace." Numerous memory allocations for these dynamically generated classes may lead to the following situations:

JDK 7:

 

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.