title: viewer.js / pdf.js: Memory usage increases every time a pdf is rendered
body: <p>My problem is that the memory usage of my application increases every time I render a pdf file with viewer.js. </p>
  
  <p>I render my pdf this way:</p>
  
  <pre><code>container = document.getElementById('viewerContainer');
  viewer = document.getElementById('viewer');
  
  pdfViewer = new PDFViewer({
      container: container,
      viewer: viewer
  });
  
  $scope.pdfFindController = new PDFFindController({
        pdfViewer: pdfViewer
  });
  
  pdfViewer.setFindController($scope.pdfFindController);
  
  container.addEventListener('pagesinit', function () {
      pdfViewer.currentScaleValue = 'page-width';                            
  });
  
  PDFJS.getDocument($scope.getPageLink(pdf)).then(function (pdfDocument) {
      documentPdf = pdfDocument;
      pdfViewer.setDocument(pdfDocument);                       
  });
  </code></pre>
  
  <p>I render the file in a separate view. When I go back to my previous view and open another file, the memory usage increases by ~20MB.</p>
  
  <p>I tried this:</p>
  
  <pre><code>documentPdf.destroy();
  </code></pre>
  
  <p>Now, the memory usage decreases a bit, but not as much as it was allocated before.</p>
  
  <p>Is there a solution for this?</p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>Pdf.js version: 1.6.210</p>
  
  <p>pdf.js worker version: 1.6.210</p>