# Memory/ performence problems with specyfic pdf files

**URL:** <https://pdfjs.community/t/memory-performence-problems-with-specyfic-pdf-files/2487>\
**Category:** Bug Reports\
**Tags:** pdfjs-express\
**Created:** [April 4, 2023, 8:49am UTC](https://pdfjs.community/t/memory-performence-problems-with-specyfic-pdf-files/2487 "2023-04-04T08:49:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![developers](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@developers](https://pdfjs.community/u/developers)\
**Post date:** [April 4, 2023, 8:49am UTC](https://pdfjs.community/t/memory-performence-problems-with-specyfic-pdf-files/2487/1 "2023-04-04T08:49:27Z")

</div>

Hello, I’ comparing the displaying of specific pdf files, on pdf.js express and original pdf.js  
[output (1).pdf](https://pdfjs.community/uploads/short-url/a8oq5kgdNkI1QLw1CxkVHI3FxM1.pdf) (961.1 KB)

I’m using Google Chrome 111

**1) original pdf.js from github**

Renders quickly when opened, no blurring, the document shows from top to bottom as you scroll. Scrolling has no effect on document rendering  
(63 MB - page + 16MB - worker)

**2) [PDF.js Viewer Demo | PDF.js Express](http://pdfjs.express/demo)**  
After choosing file, nothing is happening a longer time, after that I see blurred doc,  
I do zoom to 100%. When I try to scroll up and down I watch memory consumption in peek is increasing  
(319 MB - page + 14MB - worker)

If I scroll up and down parts are rendering memory consumption increases and I again see a blurred document, rendering is very slow

When part is rendered memory is like  
(130 MB - page + 2MB - worker)

But when I scroll up and down and clik “Remove your File” and then I choose same file from disk  
I see white area, longer time nothing is happening

Also I encored a problem after several time viewing and removing files in my application just like on demo, and it looked like memory wasn’t freed, after closing a document, and loading a new one.

In my opinion, the original pdf.js handles such files better, the rendering time is shorter, and the memory consumption is much lower.  
What is causing this behavior of pdf.js express? Can I expect any improvement?

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [April 4, 2023, 6:15pm UTC](https://pdfjs.community/t/memory-performence-problems-with-specyfic-pdf-files/2487/3 "2023-04-04T18:15:46Z")

</div>

Hi there,

Thank you for contacting pdf.js express forums,

For pdf.js express viewer, the pages are rendered only for what is currently in the viewport:

> **[PDF.js Express Viewer Events | Documentation](https://pdfjs.express/documentation/learn-more/events.8#documentviewer.pagecomplete)**

Here is our guide on PDF optimization that may help with the performance of this file:

> **[How to Optimize PDFs for Accurate Rendering in PDF.js | PDF.js Express](https://pdfjs.express/blog/optimizing-documents-for-pdf-js)**
>
> We’ve created this guide with tips on how to reduce the risks of rendering inaccuracies occurring with documents in your PDF.js viewer.

Best regards,  
Kevin Kim
