-
Backport
-
Resolution: Fixed
-
P2
-
None
-
b01
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();
}
}
}
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();
}
}
}
- backport of
-
JDK-6255588 JDK windows printing implementation leaks GDI objects.
- Resolved