Yes. I always create a new Transformer from XSLT's Template Object for
every new thread that is spawned.

I'm wondering why the first few thousands of transformations are running
smoothly and then the performance degrades!

-----Original Message-----
From: Jeff Greif [mailto:jeff.gr...@gmail.com]
Sent: Monday, December 12, 2011 9:54 PM
To: xalan-j-users@xml.apache.org
Subject: Re: Xalan Tranformation Running Slow after about 5K
Transformations

If I recall correctly, TransformerImpl is not threadsafe, and should be
used for one transformation only.

So, for each distinct stylesheet, you should have a Templates object,
used to create a Transformer for each use.  Then there should be no
contention for anything used by the Transformer.

Jeff

On 12/12/2011 6:16 AM, kaja.mohid...@wipro.com wrote:
> Hi all,
>
>
>
> My java application (running in "Java HotSpot(TM) Server VM (build
> 14.0-b16, mixed mode)" on Sun Netra T5440) using Xalan transforms
> thousands of XML files (uses 16 Threads). After it transforms about
5000
> XML files, it becomes slow and it starts transforming very slowly and
it
> takes 2mins for some transformation (where the first transformation of
> similar XML with same XSLT ran in just 2 secs). One of the Thread Dump
> is as follows
>
>
>
> java.lang.Thread.State: BLOCKED
>
>           at java.util.Vector.elementAt(Vector.java:426)
>
>           - waiting to lock <85094f> (a java.util.Vector) owned by
> "AggregatorThreadPoolThreadPool-Thread-1" t@17
>
>           at
>
org.apache.xalan.templates.ElemTemplateElement.executeNSDecls(ElemTempla
teElement.java:1182)
>
>           at
>
org.apache.xalan.templates.ElemTemplateElement.executeNSDecls(ElemTempla
teElement.java:1159)
>
>           at
>
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
ava:1318)
>
>           at
>
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Trans
formerImpl.java:2411)
>
>           at
>
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
ava:1374)
>
>           at
>
org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEac
h.java:423)
>
>           at
> org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:263)
>
>           at
>
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Trans
formerImpl.java:2411)
>
>           at
>
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
ava:1374)
>
>           at
>
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Trans
formerImpl.java:2411)
>
>           at
>
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.j
ava:1374)
>
>           at
>
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Trans
formerImpl.java:2411)
>
>           at
>
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transfo
rmerImpl.java:2281)
>
>           at
>
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerIm
pl.java:1367)
>
>           - locked <4a1e3a> (a org.apache.xml.serializer.ToXMLStream)
>
>           at
>
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:709)
>
>           at
>
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1284)
>
>           - locked <24f1ed> (a java.lang.Boolean)
>
>           at
>
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1262)
>
>
>
> I couldn't find any bug other than 2336 and 2344 that talks about
> Vector. Please share any info, by which I can achieve consistent
> performance.
>
>
>
> Thanks in advance,
>
>
>
> With regards,
>
> R Kaja Mohideen

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com

Reply via email to