title: W 8.1 PDF viewer memory consumption
body: <p>I'm developing an app for W 8.1, the app should have a PDF viewer. I'm able to render the pages but the problem is that sometimes the app crash because memory consumption. I read examples in books, webs, blogs but i can´t find a way to reduce the memory usage.</p>
  
  <p>This is my code:</p>
  
  <pre><code>public async Task LoadPagesAsync()
  {
      if ((_actualPage &lt; _totalPages))
      {
          using (_pdfPage = _pdfFile.GetPage(_actualPage))
          {                   
              using (IRandomAccessStream stream = new MemoryStream().AsRandomAccessStream())
              {
                  await _pdfPage.RenderToStreamAsync(stream);
                  var img = new BitmapImage();
                  img.SetSource(stream);
                  PageList.Add(new Page { ImageBit = img });              
              }
          }       
      }
  }
  </code></pre>
  
  <p>I get the pages while the user scroll across the flipview.
  The PDF size could vary from 10 MB to 100 MB, after the user exit the page with the PDF viewer if the app didn't crash the memory usage remains high for a while (180 - 220 MB).
  There is a way to clear the memory after the user exit the viewer or to prevent the memory consumption?</p>
  
  <p>Thanks.</p>