users@jaxb.java.net

Re: InterleaveExp object growth

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 22 Feb 2005 18:05:37 -0800

Kesavan T.S wrote:
> Hi Kohsuke,
> I tried the switching to using a single jaxb context and reusing Unmrshaller
> and upgraded to jwdsp 1.5. But from what I see the InterLeaveExp objects do
> not show up in heap dump only when I do not call setValidating(true) .

It will show up if you use a validating unmarshaller. But if you use a
single JAXBContext, you should see a lot less of them than before. Or do
you still see the same number?

> Also the marshalling time taken is very inconsistent when unmarshalling The
> time range in the test we have seen to unmarshall iis between 2ms to 60
> seconds.

Interesting. I remember somebody observed a similar problem --- the
unmarshalling performance varies greatly, but we haven't identified
what's causing it. Does that only happen when you do setValidating(true)?

> Does every call to setValidating() have any performance penalty.

It shouldn't be. The first time you do it, the RI computes things at
stores it on JAXBContext. Then the successive setValidating(true) on any
unmarshaller that came from the same JAXBContext should complete almost
instantly.

> Also how does the JAXB choose its XML parser we are using xercesImpl.jar
> 1.4.4 verison. Could that impact the performance.
> I really your appreciate help and recommendation. Our transaction volumes
> are increasing I would appreciate any recommendation to improve the
> performance

We just do SAXParserFactory.newInstance() to get a parser to use. Yes, a
parser generally affects the performance, and faster parser (like
Piccolo) does improve a performance.

Also, validation is known to be slow. You should think about turning it off.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com