title: IText HTML to PDF memory leak
body: <p>Good Day,</p>
  
  <p>I'm using itext to convert HTML to PDF. But when it invokes the <code>XMLWorkerHelper.getInstance().parseXHtml(writer, document, is);</code> its becoming slow and when I check JVisualVM, it seems that there is a memory leak.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>ByteArrayOutputStream baos = new ByteArrayOutputStream();
      Document document = new Document();
      PdfWriter writer = PdfWriter.getInstance(document, baos);        
      document.open();
      InputStream is = new ByteArrayInputStream(content.getBytes());
      XMLWorkerHelper.getInstance().parseXHtml(writer, document, is);
  
      document.close();
      return baos.toByteArray();
  </code></pre>
  
  <p>Its running on Tomcat server.</p>
  
  <p>Here is the html code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!--?xml version="1.0" encoding="UTF-8"?--&gt;
  &lt;html&gt;
   &lt;head&gt; 
      &lt;title&gt;Title&lt;/title&gt;
      
     
   &lt;/head&gt; 
      
  &lt;body&gt;  
    
        
  EXAMPLE
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks in advance.</p>