0

We work on a JMS based application that receives messages in XML format from a JMS queue. The application is deployed on Weblogic server (12c).

Having a rate of about 400-500 msgs/sec we are experiencing bad performance and accumulating backlog on the JMS queue.

I tried to profile the application using Java Mission Control and after recording one minute of activity of the system I found that there is a lot of contention on access phase to Zip (Jar) files by the Weblogic classloader.

The operation that was performed by my JMS MDB when the contention is detected is the XML file content unmarshalling using JAXB.

Any hint on what can cause the issue?

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43

1 Answers1

4

A possibility is that you are doing repeated calls on a JAXP factory method like XMLParserFactory.getInstance(), which involves searching the classpath and inspecting the JAR files. These methods are intended to be called once only when the application is initialised. (As well as reusing the factory, it's also beneficial to reuse the XML parser itself - at any rate, that was the case at one time.)

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
  • Thank you for your answer Michael, actually I'm creating the JAXBContext only once and, for each message, I'm creating the unmarshaller from that context. Then, the unmarshaller is used to transform the XML string in java class. Do you suggest to create directly the unmarsheller? – Francesco Fornari Mar 12 '21 at 12:11
  • Apparently I have probably the same problem reported here: https://stackoverflow.com/questions/58376695/factoryfinder-performance-bad-caching but I don't understand how to solve it. – Francesco Fornari Mar 12 '21 at 12:33