[jdom-interest] SAXBuilder in JSP session scope object
Jason Hunter
jhunter at collab.net
Tue Jun 26 12:04:45 PDT 2001
LIU Nianwei wrote:
>
> I have a SESSION scope Java Bean in a JSP page using a
> SAXBuilder. Assume we use the JAXP default SAXParser
> crimson parser.
> My question is: Is there a big difference in memory
> usage between the following two approaches:
> 1. Each session object has its own SAXBuilder.
> 2. create an external APPLICATION scope synchronized
> pool to store a group of SAXBuilders, and get/return
> instances from pool each time the page get executed.
SAXBuilder isn't intrinsically thread safe, so if you share an instance
you'll have to synchronize to serialize access. Might as well just use
different instances. The memory used is minimal.
-jh-
More information about the jdom-interest
mailing list