Java high CPU due to concurrent HashMap access in Apache Axis TypeMappingImpl.internalRegister
Environment
- JBoss Enterprise Application Platform (EAP)
- Apache Axis
Issue
- We are seeing high CPU due to multiple threads accessing the same HashMap at once in Apache Axis TypeMappingImpl, for example:
Thread: http-0.0.0.0-8080-5 state=runnable
java.util.HashMap.put
org.apache.axis.encoding.TypeMappingImpl.internalRegister
org.apache.axis.encoding.TypeMappingImpl.register
org.apache.axis.encoding.TypeMappingDelegate.register
org.apache.axis.client.Call.registerTypeMapping
org.apache.axis.client.Call.registerTypeMapping
Resolution
- Await a fix to Apache Axis
- Red Hat does not support Apache Axis; you can consider migrating to a supported web service stack instead.
- You could consider adding synchronization lower in the application layer to try to prevent the improper concurrency at the Axis layer.
Root Cause
- Concurrent access to a single HashMap can cause high cpu loops per High CPU due to multiple Java threads accessing HashMap simultaneously
- This results from an Apache Axis bug allowing HashMap access that is not thread safe:
Components
Category
Tags
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.