Diagnosing G1 Young GC Slowdown Caused by Excessive XStream ClassLoader Creation
The investigation revealed that repeatedly creating XStream objects generated thousands of CompositeClassLoader instances, inflating the JVM’s SystemDictionary and causing extremely long Ext Root Scanning during G1 Young GC pauses, which was resolved by caching XStream per class and reducing YGC pauses from seconds to milliseconds.