Java - Out Of Memory Error?

214 views
Skip to first unread message

Bernie

unread,
Feb 13, 2017, 5:50:46 PM2/13/17
to qz-print
Hi,

I'm trying to print a PDF document that is only 10kb but I'm noticing this error in my QZ log file; what could be causing this error? 

2017-02-13 17:32:26,966 [DEBUG] Message: {"call":"printers.find","promise":{},"params":{"query":"Samsung Universal Print Driver 2"},"signature":"","timestamp":1487025146937,"uid":"sdf3cy"}
2017-02-13 17:32:28,290 [INFO] Allowed OVH to access connected printers
2017-02-13 17:32:28,336 [DEBUG] Searching for PrintService matching Samsung Universal Print Driver 2
2017-02-13 17:32:28,595 [DEBUG] Found 9 printers
2017-02-13 17:32:28,595 [DEBUG] Found match: Samsung Universal Print Driver 2
2017-02-13 17:32:28,632 [DEBUG] Message: {"call":"print","promise":{},"params":{"printer":{"name":"Samsung Universal Print Driver 2"},"options":{"colorType":"color","copies":1,"density":0,"duplex":false,"fallbackDensity":600,"interpolation":"bicubic","jobName":null,"margins":0,"orientation":"portrait","paperThickness":null,"printerTray":null,"rasterize":true,"rotation":0,"scaleContent":true,"size":{"width":"8.5","height":"11"},"units":"in","altPrinting":false,"encoding":null,"endOfDoc":null,"perSpool":1},"data":[{"type":"pdf","data":"http://domain.com/uploads/tmp/58a233fc266c3.pdf"}]},"signature":"","timestamp":1487025148602,"uid":"cyp7j3"}
2017-02-13 17:32:28,636 [INFO] Allowed OVH to print to Samsung Universal Print Driver 2
2017-02-13 17:32:29,386 [DEBUG] Allowing 1 simultaneous processors based on memory available (518 MB)
2017-02-13 17:32:29,415 [DEBUG] Using qz.printer.action.PrintPDF to print
2017-02-13 17:32:29,416 [DEBUG] Searching for PrintService matching Samsung Universal Print Driver 2
2017-02-13 17:32:29,416 [DEBUG] Found 9 printers
2017-02-13 17:32:29,416 [DEBUG] Found match: Samsung Universal Print Driver 2
2017-02-13 17:32:29,982 [DEBUG] Found Resolution: 60000x60000 dphi
2017-02-13 17:32:31,219 [DEBUG] Parsed 1 files for printing
2017-02-13 17:32:31,574 [INFO] Starting printing (1 copies)
2017-02-13 17:32:36,345 [ERROR] Connection error
java
.lang.RuntimeException: Cannot call method public void qz.ws.PrintSocketClient#onMessage(org.eclipse.jetty.websocket.api.Session, java.io.Reader) with args: [org.eclipse.jetty.websocket.common.WebSocketSession, org.eclipse.jetty.websocket.common.message.MessageReader]
    at org
.eclipse.jetty.websocket.common.events.annotated.CallableMethod.unwrapRuntimeException(CallableMethod.java:93)
    at org
.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:75)
    at org
.eclipse.jetty.websocket.common.events.annotated.OptionalSessionCallableMethod.call(OptionalSessionCallableMethod.java:68)
    at org
.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver$2.run(JettyAnnotatedEventDriver.java:210)
    at org
.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org
.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java
.lang.Thread.run(Unknown Source)
Caused by: java.lang.OutOfMemoryError: Java heap space
    at java
.awt.image.DataBufferInt.<init>(Unknown Source)
    at java
.awt.image.Raster.createPackedRaster(Unknown Source)
    at java
.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
    at java
.awt.image.BufferedImage.<init>(Unknown Source)
    at org
.apache.pdfbox.printing.PDFPrintable.print(PDFPrintable.java:175)
    at sun
.awt.windows.WPathGraphics.redrawRegion(Unknown Source)
    at sun
.print.RasterPrinterJob.printPage(Unknown Source)
    at sun
.print.RasterPrinterJob.print(Unknown Source)
    at qz
.printer.action.PrintPixel.printCopies(Unknown Source)
    at qz
.printer.action.PrintPDF.print(Unknown Source)
    at qz
.utils.PrintingUtilities.processPrintRequest(Unknown Source)
    at qz
.ws.PrintSocketClient.processMessage(Unknown Source)
    at qz
.ws.PrintSocketClient.onMessage(Unknown Source)
    at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun
.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun
.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java
.lang.reflect.Method.invoke(Unknown Source)
    at org
.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:70)
   
... 5 more



Thank you!

Kyle La Barge

unread,
Feb 13, 2017, 6:16:45 PM2/13/17
to Bernie, qz-print
Are you running 32-bit or 64-bit Java? The default InitialHeapSize in the 32-bit JVM is much lower, sometimes causing this OutOfMemoryError We have a related bug report here.

If you can confirm that Java is 64-bit, can you provide is with a PDF so we can reproduce the error and advise?



Thanks,

Kyle LaBarge
Technical Support
QZ Industries, LLC
ky...@qz.io


--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bernie

unread,
Feb 13, 2017, 6:23:17 PM2/13/17
to qz-print, olim...@gmail.com
Hi,

It looks like I have 32-bit installed; should I install 64-bit instead?

C:\Users\WINDOWS>java -XX:+PrintFlagsFinal -version | find "HeapSize"
    uintx
ErgoHeapSizeLimit                        = 0                                   {product}
    uintx
HeapSizePerGCThread                  = 67108864                            {product}
    uintx
InitialHeapSize                          :   = 16777216                            {product}
    uintx
LargePageHeapSizeThreshold        = 134217728                           {product}
    uintx
MaxHeapSize                              := 268435456                           {product}
java version
"1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode, sharing)



Thank you.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.

Kyle La Barge

unread,
Feb 13, 2017, 6:29:29 PM2/13/17
to Bernie, qz-print
We recommend running the 64-bit version of Java when possible.

Can you please install the 64-bit version and let us know if your problem still exists?

Regards,
Kyle

To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.

Bernie

unread,
Feb 13, 2017, 6:45:38 PM2/13/17
to qz-print, olim...@gmail.com, kdla...@gmail.com
Hi Kyle,

Yes, that fixed my problem; I was able to successfully print this time around with 64-bit Java installed.

Thank you.

Kyle La Barge

unread,
Feb 13, 2017, 9:26:25 PM2/13/17
to Bernie, qz-print
Hey Bernie,

I would also like to mention that this problem may be resolved if you switch to rasterize: false } in the config.

Note that PDF printing in macOS requires rasterize: true } to prevent crashing.

Regards,
Kyle

Bernie

unread,
Feb 13, 2017, 10:56:59 PM2/13/17
to qz-print, olim...@gmail.com, kdla...@gmail.com
Hi Kyle,

Where is the config file where I would need to add this?

Thank you.

Tres Finocchiaro

unread,
Feb 13, 2017, 11:06:37 PM2/13/17
to Bernie, qz-print, Kyle La Barge
qz.configs.create(..., { here });
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.

Bernie

unread,
Feb 13, 2017, 11:20:16 PM2/13/17
to qz-print, olim...@gmail.com, kdla...@gmail.com
Ok, thank you...

I'm printing out documents that have barcodes on them and I'm noticing the individual barcode line edges are not printing out smooth; it almost looks like they're jagged edges.

How would I be able to print out the PDF at a higher resolution so the barcode lines are smooth?

Thank you.

Tres Finocchiaro

unread,
Feb 13, 2017, 11:29:08 PM2/13/17
to Bernie, qz-print, Kyle La Barge
How would I be able to print out the PDF at a higher resolution so the barcode lines are smooth?

{ rasterize: false }
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages