Hi,

Submit a patch and I'll take a look at it. I wonder if explicitly
nulling out the document after you're done with it would solve the
problem?

Colm.

On Fri, Sep 17, 2010 at 2:08 PM, Chefo <[email protected]> wrote:
> Hi guys,
> I would like to suggest a tiny extension to the xmlsec java API, namely to
> add a static method like unregisterDocument to
> org.apache.xml.security.utils.IdResolver to remove adocument from the static
> "docMap" WeakHashMap.
> The reason behind this is the following: I'm using apache axis2 web service
> implementation with its security module that uses wss4j and respectively
> xmlsec. When set under stress (800+ signed SOAP transactions) after certain
> period of time (5 - 10 minutes) the system hangs and all working threads are
> in the following state:
> "HTTP Handler 10.20.32.55" Id=185 in RUNNABLE
>  at java.util.WeakHashMap.get(WeakHashMap.java:355)
>  at org.apache.xml.security.utils.IdResolver.registerElementById(Unknown
> Source)
>  at org.apache.xml.security.signature.XMLSignature.setId(Unknown Source)
>  at
> org.apache.ws.security.message.WSSecSignature.prepare(WSSecSignature.java:360)
>  at
> org.apache.rampart.builder.BindingBuilder.getSignatureBuider(BindingBuilder.java:387)
>  at
> org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:716)
>  at
> org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:433)
>  at
> org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:95)
>  at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147)
>  at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:79)
>  at org.apache.axis2.engine.Phase.invoke(Phase.java:325)
>  at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
>  at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:429)
> ...
> 100% cpu utilization, almost nothing processed. Sometimes the system
> recovers a bit and than hangs again. The issue is observed on java 6 only.
> My wild guess is that the static weak hash map is filled faster than the gc
> is cleaning it. I guess there is some way to tweak the gc in java 6 and get
> over this but a simple method to remove registered dom document from the map
> after the processing has finished does the job neatly.
> I will submit a patch if you agree with the proposed extension.
> Thanks in advance,
> Chefo

Reply via email to