You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Drazen Dotlic (Created) (JIRA)" <ji...@apache.org> on 2011/11/02 23:23:32 UTC

[jira] [Created] (PIVOT-815) Printing crashes with Out Of Memory exception

Printing crashes with Out Of Memory exception
---------------------------------------------

                 Key: PIVOT-815
                 URL: https://issues.apache.org/jira/browse/PIVOT-815
             Project: Pivot
          Issue Type: Bug
          Components: wtk, wtk-terra
    Affects Versions: 2.1
         Environment: Windows 7 x64, Java 1.6.0_29
            Reporter: Drazen Dotlic


Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.

This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:


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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
	at sun.print.PeekGraphics.drawImage(Unknown Source)
	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
	at sun.print.RasterPrinterJob.printPage(Unknown Source)
	at sun.print.RasterPrinterJob.print(Unknown Source)

If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Noel Grandin (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142974#comment-13142974 ] 

Noel Grandin commented on PIVOT-815:
------------------------------------

Please try this patch:


Index: ApplicationContext.java
===================================================================
--- ApplicationContext.java	(revision 1196545)
+++ ApplicationContext.java	(working copy)
@@ -21,6 +21,7 @@
 import java.awt.Graphics;
 import java.awt.Graphics2D;
 import java.awt.GraphicsConfiguration;
+import java.awt.PrintGraphics;
 import java.awt.RenderingHints;
 import java.awt.Transparency;
 import java.awt.dnd.DnDConstants;
@@ -425,6 +426,10 @@
 
         @Override
         public void paint(Graphics graphics) {
+            if (graphics instanceof PrintGraphics) {
+                print(graphics);
+                return;
+            }
             // Intersect the clip region with the bounds of this component
             // (for some reason, AWT does not do this automatically)
             graphics.clipRect(0, 0, getWidth(), getHeight());
@@ -455,6 +460,25 @@
         }
 
         @Override
+        public void print(Graphics graphics) {
+            // Intersect the clip region with the bounds of this component
+            // (for some reason, AWT does not do this automatically)
+            graphics.clipRect(0, 0, getWidth(), getHeight());
+
+            java.awt.Rectangle clipBounds = graphics.getClipBounds();
+            if (clipBounds != null
+                && !clipBounds.isEmpty()) {
+                try {
+                    // When printing, there is no point in using offscreen buffers.
+                    paintDisplay((Graphics2D)graphics);
+                } catch (RuntimeException exception) {
+                    System.err.println("Exception thrown during print(): " + exception);
+                    throw exception;
+                }
+            }
+        }
+
+        @Override
         public void update(Graphics graphics) {
             paint(graphics);
         }

                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: PrintUtilities.java
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Sandro Martini (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13147836#comment-13147836 ] 

Sandro Martini commented on PIVOT-815:
--------------------------------------

Yes, I think that could be something changed in latest updates in Java ...

At Office (where all works) I have Windows XP SP ... at 32 bit with the following JDK/JRE:
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
I'm sorry but here I'm not able to test with different versions of Java ... 

I'll try asap at home on different PC (and different versions od OS and Java).

                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, PrintUtilities.java, pivot_511 - Applet.launch
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Drazen Dotlic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13147800#comment-13147800 ] 

Drazen Dotlic commented on PIVOT-815:
-------------------------------------

Sandro and Noel,

The patch does not work, but the reason is a bit strange.

I just checked and for the other bug (Pivot-805, Labels won't print) we definitely concluded that the right interface to test would be if the Graphics instance implemented java.awt.PrintGraphics.

However, on my machine (64-bit Windows 7, 32-bit Java 1.6.0_29) the interface is now java.awt.print.PrinterGraphics???

I am not sure if this was a recent change in Java (probably) but that's the situation. I guess the test should include both of these interfaces (it might even be the case that the latter is more modern version of the former).

This is a simple enough change, but I would definitely be interested to know which of these two interfaces you encounter on your machines while printing?


Hoping for a quick patch, thanks again.

                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, PrintUtilities.java, pivot_511 - Applet.launch
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Drazen Dotlic (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Drazen Dotlic updated PIVOT-815:
--------------------------------

    Attachment: PrintUtilities.java
    
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: PrintUtilities.java
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Drazen Dotlic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13147863#comment-13147863 ] 

Drazen Dotlic commented on PIVOT-815:
-------------------------------------

So, to summarize, the final (hopefully) fix should be to replace the "if" that tests if the Graphics instance is PrintGraphics to also test for PrinterGraphics (which is in java.awt.print package), like this:

if (graphics instanceof PrintGraphics || graphics instanceof PrinterGraphics) {
    print(graphics);
    return;
}


Hope this helps.
                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, PrintUtilities.java, pivot_511 - Applet.launch
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Drazen Dotlic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13143388#comment-13143388 ] 

Drazen Dotlic commented on PIVOT-815:
-------------------------------------

Sandro,

please take a look at the attached Java source - double buffering is indeed disabled during print.
                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: PrintUtilities.java
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Sandro Martini (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini updated PIVOT-815:
---------------------------------

    Affects Version/s:     (was: 2.1)
                       2.0
        Fix Version/s: 2.0.1
             Assignee: Sandro Martini
    
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Drazen Dotlic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142980#comment-13142980 ] 

Drazen Dotlic commented on PIVOT-815:
-------------------------------------

OK, great, I will direct my colleague's attention to this patch, he is the one maintaining the build. Being in the US, he'll probably see this in 6 hours of so, hopefully quickly integrate, then I'll test and we'll get back to you with our findings.

Thanks again.
                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: PrintUtilities.java
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Drazen Dotlic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142965#comment-13142965 ] 

Drazen Dotlic commented on PIVOT-815:
-------------------------------------

Hi Noel,

thanks for the very quick response.

Unfortunately, we can't call a different method - our PrintService is actually based on this code: http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Printing/PrintUtilities.java (we renamed PrintUtilities to PrintService, we added a bit of code to better support scaling content to the page but nothing of significance has been modified; I've also attached the original file to this issue).

Ultimately, what we're printing is an AWT Component, so there's no Pivot (conceptually) at this level (PrintService class is in a JAR "low" in our dependency graph and does not depend on Pivot in any way).

There is a way for you to detect this situation - Graphics instance will be of a different type when you print - it will be PrintGraphics. This has been confirmed by an unrelated patch for the issue 805: https://issues.apache.org/jira/browse/PIVOT-805

Hope this helps, if not, just let me know. We're very grateful for your support and all the effort in building Pivot. Keep up the good work!

                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Drazen Dotlic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13147590#comment-13147590 ] 

Drazen Dotlic commented on PIVOT-815:
-------------------------------------

OK, I just tried but our internal build doesn't seem to be synced with the trunk yet. Since it takes only a few minutes to try, I'll try again tonight and tomorrow. Will keep you posted.
                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, PrintUtilities.java, pivot_511 - Applet.launch
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Sandro Martini (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini updated PIVOT-815:
---------------------------------

    Attachment: ApplicationContext.java

latest version, with the improvement suggested by Drazen
                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, ApplicationContext.java, PrintUtilities.java, pivot_511 - Applet.launch
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Sandro Martini (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini updated PIVOT-815:
---------------------------------

    Attachment: ApplicationContext.java

latest version of patched source (from trunk), to simplify test
                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, PrintUtilities.java
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Sandro Martini (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini resolved PIVOT-815.
----------------------------------

    Resolution: Fixed
    
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, PrintUtilities.java, pivot_511 - Applet.launch
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Drazen Dotlic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13147575#comment-13147575 ] 

Drazen Dotlic commented on PIVOT-815:
-------------------------------------

Sandro,

I apologize for the lack of feedback. Our internal build "workflow" is much simplified if the patch ends up in the trunk, which we'll pick up and use more or less automatically. From what I've seen, the attempted fix has indeed landed in the trunk, so we should be able to test this easily.

I am however tied up with some other work I must finish by the end of the week, so confirmation of the fix might require a few more days, but not more than that.

Thanks again to all committers for their hard work.
                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, PrintUtilities.java, pivot_511 - Applet.launch
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Sandro Martini (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini reopened PIVOT-815:
----------------------------------

    
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, PrintUtilities.java, pivot_511 - Applet.launch
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Sandro Martini (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13147568#comment-13147568 ] 

Sandro Martini commented on PIVOT-815:
--------------------------------------

Hi all,
after some tests from latest fix (from Noel), now all seem to work in my environment.
Note that with this fix even PIVOT-511 should be solved !!

@Drazen:
the fix from Noel disable double buffering, but without using Swing classes, it's based only on Pivot and AWT Classes.
In attach I'll put (in a few minutes) an updated version of updated class (ApplicationContext.java), so you can easily try and tell to us if this if Ok even for you now.

@All: this is an important fix for Pivot, please can you test and give some feedback ?

Thank you very much.

                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, PrintUtilities.java
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Noel Grandin (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142949#comment-13142949 ] 

Noel Grandin commented on PIVOT-815:
------------------------------------

Can you try this patch, and change your PrintService code to call print(Graphics) instead of paint(Graphics)


Index: ApplicationContext.java
===================================================================
--- ApplicationContext.java	(revision 1196545)
+++ ApplicationContext.java	(working copy)
@@ -455,6 +455,33 @@
         }
 
         @Override
+        public void print(Graphics graphics) {
+            // Intersect the clip region with the bounds of this component
+            // (for some reason, AWT does not do this automatically)
+            graphics.clipRect(0, 0, getWidth(), getHeight());
+
+            java.awt.Rectangle clipBounds = graphics.getClipBounds();
+            if (clipBounds != null
+                && !clipBounds.isEmpty()) {
+                try {
+                    // When printing, there is no point in using offscreen buffers.
+                    paintDisplay((Graphics2D)graphics);
+
+                    if (debugPaint) {
+                        graphics.setColor(new java.awt.Color(random.nextInt(256),
+                            random.nextInt(256), random.nextInt(256), 75));
+                        graphics.fillRect(0, 0, getWidth(), getHeight());
+                    }
+                } catch (RuntimeException exception) {
+                    System.err.println("Exception thrown during print(): " + exception);
+                    throw exception;
+                }
+            }
+
+            paintPending = false;
+        }
+
+        @Override
         public void update(Graphics graphics) {
             paint(graphics);
         }

                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Sandro Martini (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini updated PIVOT-815:
---------------------------------

    Attachment: pivot_511 - Applet.launch

sample eclipse launch file, to run a minimal test (using JDK AppletViewer) and try to Print from it
                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, PrintUtilities.java, pivot_511 - Applet.launch
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Sandro Martini (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini resolved PIVOT-815.
----------------------------------

    Resolution: Fixed

Finally this has been resolved.

Drazen (and all others), be free to reopen the issue in case of problems.

                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: ApplicationContext.java, ApplicationContext.java, PrintUtilities.java, pivot_511 - Applet.launch
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-815) Printing crashes with Out Of Memory exception

Posted by "Sandro Martini (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13143353#comment-13143353 ] 

Sandro Martini commented on PIVOT-815:
--------------------------------------

To fix thing is a good way we need a better test case ... at least a minimal sample from Drazen sources.
In any case I'll try from appletviewer ...

But note that as written in the article linked here ( https://issues.apache.org/jira/browse/PIVOT-805?focusedCommentId=13143346&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13143346 ) huge memory usage during print could be due to double beffering / wrong scaling of graphics from Java (Java2D) ... a workaround could be to disable it during print (from Browser and/or using only java functions), BUT so we need a clear way to understand when the browser is Printing ... if someone has some idea ...

                
> Printing crashes with Out Of Memory exception
> ---------------------------------------------
>
>                 Key: PIVOT-815
>                 URL: https://issues.apache.org/jira/browse/PIVOT-815
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>    Affects Versions: 2.0
>         Environment: Windows 7 x64, Java 1.6.0_29
>            Reporter: Drazen Dotlic
>            Assignee: Sandro Martini
>              Labels: crash, outofmemory, printing
>             Fix For: 2.0.1
>
>         Attachments: PrintUtilities.java
>
>
> Printing using Java's Printable interface... We have a single Pivot Window (it's an applet) and the layout isn't really complicated. Implementing print method of the Printable interface in our case boils down to drawing into the provided Graphics.
> This has worked perfectly until recently (not sure which version broke things, but we're talking last few weeks). Now when we print we get an "Out of Memory" exception. Call stack does not show any obvious anomalies like infinite loops and such, here it is:
> 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 sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
> 	at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
> 	at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.makeBufferedImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.renderImageXform(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.scaleImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
> 	at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.copyImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
> 	at sun.print.PeekGraphics.drawImage(Unknown Source)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(ApplicationContext.java:541)
> 	at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(ApplicationContext.java:436)
> 	at com.barchart.realtime.core.service.PrintService.paint(PrintService.java:60)
> 	at com.barchart.realtime.core.service.PrintService.print(PrintService.java:84)
> 	at sun.print.RasterPrinterJob.printPage(Unknown Source)
> 	at sun.print.RasterPrinterJob.print(Unknown Source)
> If you need more info, do not hesitate to ask. I would have provided a test case, but it's not easy to extract code from a commercial product. Besides, I suspect this is some kind of obvious accidental mistake which should be easy to repeat with a very simple test case.pr

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira