Support Article
"Unloading class" and "CodeCache is full" messages in logs
SA-21882
Summary
Several occurrences of "Unloading class" messages on server.
Error Messages
[Unloading class sun.reflect.GeneratedConstructorAccessor3153]
[Unloading class sun.reflect.GeneratedConstructorAccessor2967]
[Unloading class sun.reflect.GeneratedMethodAccessor614]
[Unloading class sun.reflect.GeneratedConstructorAccessor3155]
and
Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
Steps to Reproduce
Start server.
Root Cause
A defect or configuration issue in the operating environment, specifically JVM argument tuning.
Resolution
Make the following change to the operating environment:
Add the following JVM arguments (for a total heap of 8G):
-XX:+CMSClassUnloadingEnabled
-XX:ReservedCodeCacheSize=512m (increase as needed)
-XX:+UseCodeCacheFlushing
-XX:NewSize=2048m
-XX:MaxNewSize=2048m
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=75
-XX:+DisableExplicitGC
Remove:
-XX:+PrintTenuringDistribution
-XX:ReservedCodeCacheSize=512m (increase as needed)
-XX:+UseCodeCacheFlushing
-XX:NewSize=2048m
-XX:MaxNewSize=2048m
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=75
-XX:+DisableExplicitGC
Remove:
-XX:+PrintTenuringDistribution
Published April 11, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.