问题
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