We have developer a Web-Service using JAX-WS 2.2 JAXB 2.x over SOAP 1.1. The services are running on WebSphere Application Server 188.8.131.52 on z/OS. They are fully functional but we see even a simple operation is taking huge amount of CPU.
We could see from profiling tools like Dynatrace or JProfiler that JAXBContext creation (newInstance) and IBM API classes of JAXB is chewing up 90% of the CPU. 10% is business logic.
We need to tune the service on z/OS and bring down the CPU usage:
Based on our research it seems JAXBContext creation is very costly and we can create JAXBContext under application scope in the first request and then cache it for successive calls. Seen the annotation on JAX-WS @Usesjaxbcontext.
Any help/sample code snippet on how to cache the JAXBContext and use @usesjaxbcontext annotation will be much appreciated. Or if you have any suggestions on how to tune CPU usage of the service on z/OS WAS-8.x will help.