dev@jax-ws.java.net

Re: XMLStreamReader recycling <was> [Fwd: CVS update [mr-21]: /jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/message/stream/]

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 12 Jan 2007 10:07:12 +0100

Kohsuke Kawaguchi wrote:
> Paul Sandoz wrote:
>> This recycling is related to the same issue for the FI StAX parsers.
>>
>> I have not looked deeply at the code but it looks like the right place
>> to support the recycling of XML *and* FI XMLStreamReader instances.
>
> Yeah, we can do that. The easiet way is to have FI's XMLStreamReader
> implement RecycleAware. If needed we can move this interface on stax-ex
> to do this.
>

A FI XMLStreamReader instance automatically resets itself when an
InputStream is set so it is not strictly necessary to implement this
interface.


>> I am wondering if it is possible to also recycle stream buffers i.e.
>> when the message is no longer used.
>
> I think we should first check if it's indeed costly.

Agreed, profiling for cases where non-security header blocks are present
should tell is more.

The reason i have a hunch is the fact that XML StAX parser creation
showed up in the profiler mainly because it created a whole bunch of
memory that could be reused. The same will happen with the streambuffer
for headers.

Paul.

> So far, it doesn't
> seem like this is a big enough problem. Pooling has its own overhead and
> problems, too.
>
> Finding out when a Message is no longer in use is harder than finding
> that out for XMLStreamReader, so doing this is more work. We need
> benefits that justify this work.
>

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109