8176168: Performance drop due to SAXParser SymbolTable reset
authoraefimov
Mon, 24 Apr 2017 18:21:46 +0300
changeset 44804 760e75de808d
parent 44715 a52b758eed5c
child 44805 72605dc10422
child 44874 62f35f67d300
8176168: Performance drop due to SAXParser SymbolTable reset Reviewed-by: joehw, lancea
jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java	Thu Apr 20 18:14:05 2017 +0000
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java	Mon Apr 24 18:21:46 2017 +0300
@@ -46,6 +46,10 @@
     public ParserPool(int capacity) {
         queue = new ArrayBlockingQueue<SAXParser>(capacity);
         factory = SAXParserFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl", SAAJUtil.getSystemClassLoader());
+        try {
+            factory.setFeature("jdk.xml.resetSymbolTable", true);
+        } catch(SAXException | ParserConfigurationException e) {
+        }
         factory.setNamespaceAware(true);
         for (int i = 0; i < capacity; i++) {
            try {