[Unloading class sun.reflect.GeneratedMethodAccessor] found in Tomcat logs

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Symptoms

The instance will have become unstable and will either have frozen or crashed and usually requires to be restarted.

Error messages similar to the following will populate the catalina.out log file, often flooding large sections of it:

1 2 3 4 5 6 7 8 [Unloading class sun.reflect.GeneratedMethodAccessor1356] [Unloading class sun.reflect.GeneratedMethodAccessor2866] [Unloading class sun.reflect.GeneratedMethodAccessor2706] [Unloading class sun.reflect.GeneratedMethodAccessor1150] [Unloading class sun.reflect.GeneratedMethodAccessor4528] [Unloading class sun.reflect.GeneratedMethodAccessor5153] [Unloading class sun.reflect.GeneratedMethodAccessor2913] [Unloading class sun.reflect.GeneratedMethodAccessor916]

Diagnosis

If you see these errors in your Tomcat logs and you have NOT added both of the following JVM arguments to your startup options then you are experiencing this problem.

1 2 -XX:+CMSClassUnloadingEnabled -XX:-UseConcMarkSweepGC

Cause

This type of issue occurs when the JVM finds it physically does not have the resources that have been allocated to it, (usually due to either VM ballooning or resource stealing), at which point the JVM will panic and start unloading classes from the PermGen memory in order to place the object in memory that it still controls. If it achieves this and its resources are released by the entity stealing them, the application will appear to return to normal, but usually it is unable to do this and the application will crash with no logging as to what occurred.

Solution

Resolution

The only way to stop this from happening is to prevent the ballooning/stealing from occurring, some suggestions to do this can be found below:

  • Allocate more resources to your server.

  • Reduce the load on the server from other applications.

  • Isolate the server better so that it doesn't get its resources stolen in the first place.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.