title: XSLT Transformation: newTransformer versus newTemplates with respect to class loading
body: <p>My program has a multi-threading environment where I don't have control over spawning of threads, but some framework that I use has the control.</p>
  
  <p>I found that the use of <code>newTemplates(XSLstreamsource)</code> is threadsafe, while <code>newTransformer(XSLstreamsource)</code> is not. But what I would like to know, really, is if there is any difference between these two with respect to loading of the implementation class in to JVM.</p>
  
  <p>The problem that I am facing now is that every <code>newTransformer</code> call (in the various threads) loads the class, thus occupying the perm gen memory portion highly. </p>
  
  <p>I would like to know if <code>newTemplates</code> would load the class only once, as against <code>newTransformer</code>. Or are there solutions to avoid the class getting loaded every time?</p>