Increase in Metaspace with TransformerFactory's XSLT Transformer

僤鯓⒐⒋嵵緔 提交于 2019-12-25 01:41:46

问题


When I run the following code with multiple different requests, the java metaspace is getting increased.

        public String applyXsltOnXml(String xmlString, String xsltInput) throws TransformerException {
         String result = null;
         try (StringReader stringReader = new StringReader(xmlString);
                 StringWriter writer = new StringWriter()) {
             TransformerFactory factory = TransformerFactory.newInstance();
             Transformer transformer = factory.newTransformer(new StreamSource(new StringReader(xsltInput)));
             transformer.transform(new StreamSource(stringReader), new StreamResult(writer));
             result = writer.toString();
         } 
         return result;
     }

Could you please explain what is happening behind the scenes ? why the java metaspace is getting increased ?

来源:https://stackoverflow.com/questions/58091381/increase-in-metaspace-with-transformerfactorys-xslt-transformer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!