Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6255588

JDK windows printing implementation leaks GDI objects.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 1.4.0, 1.4.2_10, 5.0
    • client-libs
    • 2d
    • beta
    • generic, x86
    • generic, windows_2000, windows_xp

        The JDK's windows printing implementation is leaking GDI objects : 2 per job
        seems typical but it's not a "per-job" leak.
        Its observable in a process which creates and in some minimal way uses
        one or more PrinterJobs as both a growth in native process size (not Java heap)
        and in the windows task manager as a leak in GDI Objects (select the column
        to view this).

        A program as simple as this can demonstrate the problem:

        import java.awt.print.*;

        public class PT {

            public static void main(String[] args) {
                PrinterJob printerJob = PrinterJob.getPrinterJob();
                for (int i=0;i<10000;i++) {
                    printerJob.defaultPage();
                }
            }
        }
        ###@###.### 2005-04-14 21:14:29 GMT

              prr Philip Race
              prr Philip Race
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: