Using JBoss 6.1 with Apache-CXF 2.3.1, inc WSS4J 1.5.8:
I have noted that it seems to be easy to max out the heap space. Most of my
issues seem to occur during encryption, like the stack trace at the end of this
message. We have many operations that accept date ranges as selection
criteria. This particular stack trace occurred with a JVM max heap size of 3
gigabytes attempting to return 55,270 hefty, but not what I would have thought
grossly oversized objects.
My questions are these:
1) What do most people do to mitigate these sorts of memory issues? Chunking?
We roll our own "chunking"; I've seen allusions to some sort of "built-in"
chunking, but didn't understand what I was reading. Limiting date ranges?
Other strategies?
2) Upgrading to more modern versions of JBoss/CXF/WSS4J is NOT a possibility
at this time, but is this much improved with more recent versions?
java.lang.OutOfMemoryError: Java heap space
java.util.Arrays.copyOfRange(Unknown Source)
java.lang.String.<init>(Unknown Source)
java.lang.StringBuffer.toString(Unknown Source)
org.apache.xml.security.encryption.XMLCipher.encryptData(Unknown Source)
org.apache.xml.security.encryption.XMLCipher.encryptData(Unknown Source)
org.apache.xml.security.encryption.XMLCipher.encryptElementContent(Unknown
Source)
org.apache.xml.security.encryption.XMLCipher.doFinal(Unknown Source)
org.apache.ws.security.message.WSSecEncrypt.doEncryption(WSSecEncrypt.java:593)
org.apache.ws.security.message.WSSecEncrypt.doEncryption(WSSecEncrypt.java:459)
org.apache.ws.security.message.WSSecEncrypt.encryptForInternalRef(WSSecEncrypt.java:348)
org.apache.ws.security.message.WSSecEncrypt.build(WSSecEncrypt.java:309)
org.apache.ws.security.action.EncryptionAction.execute(EncryptionAction.java:62)
org.apache.ws.security.handler.WSHandler.doSenderAction(WSHandler.java:202)
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor.access$200(WSS4JOutInterceptor.java:50)
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:257)
org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:134)
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:97)
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:461)
org.jboss.wsf.stack.cxf.ServletControllerExt.invoke(ServletControllerExt.java:172)
org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:57)
org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:156)
org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:90)
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
Thanks.