New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to print large documents in Electron 4, 5 #16813

Open
justin-elliott opened this Issue Feb 7, 2019 · 1 comment

Comments

3 participants
@justin-elliott
Copy link

justin-elliott commented Feb 7, 2019

  • Electron Version (output of node_modules/.bin/electron --version):
    • 4.0.4
    • 5.0.0-beta.2
  • Operating System (Platform and Version):
    • Windows 10 Pro (1803)
  • Last known working Electron version (if applicable):
    • 3.1.3

Expected Behavior

When printing a large document, every page should print successfully.

Actual behavior

When printing a large document, printing fails before completing, or produces a run of blank pages at the end. Given the number of pages involved, 800+, this has only been tested through print-to-file drivers such as Microsoft Print to PDF, and Microsoft XPS Document Writer.

This appears to be memory-related, as memory usage climbs for each additional page spooled. Prior versions of Electron did not exhibit increasing memory usage during page spooling.

To Reproduce

This issue was first observed in a PDF.js-based viewer embedded in our application. I have created a simple application that emulates PDF.js printing behavior, here:

https://github.com/justin-elliott/electron-printing-bug

The README contains details of the testing that I have conducted.

@ablesser

This comment has been minimized.

Copy link

ablesser commented Feb 7, 2019

I've reproduced this with a video showing what happens with windows memory as it creeps up to the 64 gb VMemory limit on my machine and then fails near ~2200 pages out of 2500 using the test app @justin-elliott provided. I also show Resource monitor live monitoring during the process showing electron consuming ungodly amounts of memory (50 + GB) before everything falls over.

Note that the output PDF is 0kb / blank in this case, as the print spooling process (which seems to be running under electron's memory footprint) just seems to fall over.

I also show that windows event viewer triggers a resource exhaustion warning, which may relate to why the process ultimately terminates. Clearly , though this is some sort of memory leak/bloat that didn't exist before.

@sofianguy sofianguy added this to Unsorted Issues in 5.0.x Feb 7, 2019

@sofianguy sofianguy moved this from Unsorted Issues to Doesn't Block Stable in 5.0.x Feb 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment