Hi,

On 15.02.2012 07:59, Bhushan Shelke wrote:
Hello All,

I am using castor(1.2, upgraded to 1.3.2 as well) as data binding
framework in one of the project. External systems (6 to be precise) send
xml data (moderate) every second. Then we use castor to marshal/un
marshal at various places in code.

Problem I am facing is – during unmarshalling process castor doesn’t
seem to pool (cache) the parsers (SAX), hence ends up looking up and
then creating/loading parser for every request. This obviously has
performance overheads. And since this is done internally and I couldn’t
find any configuration that tells castor to pool parsers, so I’ve hit
dead end.

Under extreme load this also leads to thread blocking/ deadlocks because
of probably a defect in tomcat, when too many threads request to load
same class.

This looks like a nice feature to have in castor (if not there already).
Yes, it dies, indeed. Though thinking about this a little bit longer, I cannot think of an easy and intuitive way of approaching said subject. But feel free to raise a Jira issue and share your thoughts with us ....

Kind Regards
Werner Guttmann

Following is snapshot thread blocking I mentioned earlier –

Thread 1981: (state = BLOCKED)

-
org.apache.catalina.loader.WebappClassLoader.loadClass(java.lang.String,
boolean) @bci=0, line=1524 (Compiled frame)

-
org.apache.catalina.loader.WebappClassLoader.loadClass(java.lang.String)
@bci=3, line=1491 (Compiled frame)

- javax.xml.parsers.FactoryFinder.getProviderClass(java.lang.String,
java.lang.ClassLoader, boolean) @bci=25, line=111 (Interpreted frame)

- javax.xml.parsers.FactoryFinder.newInstance(java.lang.String,
java.lang.ClassLoader, boolean) @bci=3, line=146 (Interpreted frame)

- javax.xml.parsers.FactoryFinder.find(java.lang.String,
java.lang.String) @bci=345, line=233 (Interpreted frame)

- javax.xml.parsers.SAXParserFactory.newInstance() @bci=4, line=128
(Interpreted frame)

- org.exolab.castor.xml.util.XMLParserUtils.getSAXParser(boolean,
boolean) @bci=2, line=118 (Interpreted frame)

- org.castor.xml.AbstractInternalContext.getXMLReader(java.lang.String)
@bci=56, line=262 (Interpreted frame)

- org.castor.xml.AbstractInternalContext.getXMLReader() @bci=2, line=248
(Interpreted frame)

- org.exolab.castor.xml.Unmarshaller.unmarshal(org.xml.sax.InputSource)
@bci=8, line=692 (Interpreted frame)

-
org.springframework.oxm.castor.CastorMarshaller.unmarshalInputStream(java.io.InputStream)
@bci=12, line=386 (Interpreted frame)

-
org.springframework.oxm.support.AbstractMarshaller.unmarshalStreamSource(javax.xml.transform.stream.StreamSource)
@bci=12, line=368 (Interpreted frame)

-
org.springframework.oxm.support.AbstractMarshaller.unmarshal(javax.xml.transform.Source)
@bci=57, line=134 (Interpreted frame)

Any help/pointers would be greatly appreciated.

--Bhushan

DISCLAIMER ========== This e-mail may contain privileged and
confidential information which is the property of Persistent Systems
Ltd. It is intended only for the use of the individual or entity to
which it is addressed. If you are not the intended recipient, you are
not authorized to read, retain, copy, print, distribute or use this
message. If you have received this communication in error, please notify
the sender and delete all copies of this message. Persistent Systems
Ltd. does not accept any liability for virus infected mails.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to