Hello
i’m hitting an OutOfMemoryError when using Apache CXF 3.1.9 +
WS-ReliableMessaging and can’t find a configuration that keeps memory
stable.
Upgrading CXF is currently not forseen, but eventually could be as long
as not too much has to be changed (using ServiceMix 7.0.1 and CXF in
combination with Camel)
------------------------------------------------------------------------
Setup
*
CXF server + CXF client simulator
*
Heartbeat every second
*
Each request has a response (including heartbeat)
*
WS-RM is mandatory
*
WSDL policy:
|<wsp:Policy wsu:Id="TMS2IRISPortPolicy"> <wsp:ExactlyOne> <wsp:All>
<wsrm:RMAssertion> <wsrm:InactivityTimeout Milliseconds="600000"/>
<wsrm:AcknowledgementInterval Milliseconds="200"/> </wsrm:RMAssertion>
<wsaw:UsingAddressing/> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> |
Server created using CxfEndpoint (roughly, endpoint is then used by Camel):
|CxfEndpoint endpoint = new CxfEndpoint();
endpoint.setWsdlURL("myservice.wsdl");
endpoint.setServiceClass(MyService.class); endpoint.setServiceBean(new
MyServiceImpl());
endpoint.setAddress("http://localhost:8080/myservice"); Server server =
endpoint.create();|
------------------------------------------------------------------------
Problem
After ~1–1.5 days the log shows:
|2026-02-01 14:59:25,851 | WARN | ew I/O worker #5 | netty | 215 -
org.jboss.netty - 3.10.5.Final |
\[org.jboss.netty.channel.DefaultChannelPipeline\] An exception was
thrown by a user handler while handling an exception event (\[id:
0xe3be92fc, /127.0.0.1:54301 =\> /127.0.0.1:19934\] EXCEPTION:
java.lang.OutOfMemoryError: GC overhead limit exceeded) 2026-02-07
18:07:13,028 | WARN | er@499caabcTimer |
teInvalidatingHashSessionManager | 226 - org.ops4j.pax.web.pax-web-jetty
- 4.3.0 | Problem scavenging sessions java.lang.OutOfMemoryError: Java
heap space |
Heap dump shows:
|RMManager retransmissionQueue ≈ 3 GB |
Other symptoms:
*
“terminating sequence due to inactivity” appears much later than 10
min in the logs
*
Eventually after some hours both client and server log “unknown
sequence identifier”
------------------------------------------------------------------------
What I tried
Client simulator attempts:
*
Send|TerminateSequence|after each heartbeat
*
Send|TerminateSequence|after 300 heartbeats
Both end in OOM.
Currently i am letting the client simulator run without manually setting
a termination. But i think it will just run forever, since it is never
inactive, due to the heartbeats.
------------------------------------------------------------------------
Questions
Which WS-ReliableMessaging / RMManager / retransmission configuration
prevents the retransmission queue from growing indefinitely in CXF 3.1.9
for high-frequency traffic?
Do i have to configure the policy/RMManager myself or will it be used
automatically when it is in the WSDL?
Would the RMTxStore help? How would i add it programmatically (In the
standalone client simulator i just added the bean and config in the XML
and was working but somehow in combination with Servicemix i could not
get it to run yet)?