Java Application Performance Degrades when Multiple Threads are Processing Xstream Objects
Last updated on MARCH 15, 2018
Applies to:Java SE JDK and JRE - Version 7 and later
Information in this document applies to any platform.
A Java Application which has multiple threads creating Xstream objects for doing XML conversions with toXML() method experiences huge performance decreases between each FullGC. Performing the same task (toXML()) takes longer and longer until a FullGC. After a FullGC, the performance improves, but then gets slower and slower again until the next FullGC.
The issue can be reproduced on Linux with a program that creates a thread pool, where each thread repeatedly creates an Xstream to process toXML() calls. Such a test program shows that the time taken by a thread to complete the singular task ( toXML() ) is very fast initially (1-5 millliseconds) when the system is with less load. On increase of load, the same task is taking a longer and longer time until a FullGC is run. After the FullGC, the task is again completed in the 1-5 milliseconds, but again, successive runs of that task take longer and longer until the next FullGC.
The performance problem is initially noticed as reduced responsiveness. For example, when running such a program with WLS, this may appear as stuck threads blocked on classloader:
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms