Memory leak in AxisHttpSession

Solution Unverified - Updated

Environment

  • JBoss Enterprise Application Platform (EAP)
  • Apache Axis 1.3

Issue

  • Heap usage is growing with many accumulating org.apache.axis.transport.http.AxisHttpSession objects. These are preserved by the org.apache.axis.handlers.soap.SOAPService class's sessions table.

Resolution

  • Upgrade to Apache Axis 1.4.1+

Root Cause

  • Note that we don't support Apach Axis, but it looks like that behavior matches Content from issues.apache.org is not included.AXIS-2314. It looks like this was fixed in axis 1.4, where SOAPService was changed to store the sessions in a WeakHashMap, which will automatically release the sessions when everything else has unreferenced them, avoiding the leak. But note the WeakHashMap this fix introduced was not thread safe (Content from issues.apache.org is not included.AXIS-2878), so it looks like you should only use axis 1.4.1+ to consume that fix and not see a potential new high CPU bug introduced. It looks like in 1.4.1+ they removed this leaking sessions map altogether.
Components
Category

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.