JDK-5015137 : JPEGImageWriter.setOutput() causes full GC
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.imageio
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-03-17
  • Updated: 2004-03-17
  • Resolved: 2004-03-17
Related Reports
Duplicate :  
Description

Name: jl125535			Date: 03/17/2004


FULL PRODUCT VERSION :
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
and
SunOS wasv208 5.8 Generic_108528-16 sun4u sparc SUNW,Sun-Fire-280R


A DESCRIPTION OF THE PROBLEM :
Every time the setOutput method is called on a com.sun.imageio.plugins.jpeg.JPEGIMageWriter, System.gc() is called.

This causes a Full GC pausing the JVM. In this case for anywhere between 1.5 seconds and 18 seconds

Here is part of the verbose GC log.

26814.461: [Full GC 26814.461: [ParNew: 9374K->0K(16320K), 0.0575078 secs]26814.518: [CMS26815.892: [CMS-concurrent-mark: 5.980/6.650 secs]
: 857467K->839218K(1531904K), 13.7222990 secs] 866104K->839218K(1548224K), [CMS Perm : 27035K->26991K(65536K)], 13.7802854 secs]
26828.363: [Full GC 26828.363: [ParNew: 2872K->0K(16320K), 0.0699068 secs]26828.433: [CMS: 839266K->839117K(1531904K), 12.2023122 secs] 842091K->839117K(1548224K), [CMS Perm : 26994K->26991K(65536K)], 12.2726812 secs]
26840.786: [GC [1 CMS-initial-mark: 839117K(1531904K)] 839189K(1548224K), 0.0071782 secs]
26840.795: [CMS-concurrent-mark-start]
26841.143: [GC 26841.143: [ParNew: 16256K->0K(16320K), 0.0643938 secs] 855373K->842597K(1548224K), 0.0646792 secs]
26841.682: [GC 26841.682: [ParNew: 16256K->0K(16320K), 0.1270110 secs] 858853K->847164K(1548224K), 0.1274362 secs]
26842.370: [GC 26842.370: [ParNew: 16256K->0K(16320K), 0.0956398 secs] 863420K->850907K(1548224K), 0.0959472 secs]
26842.997: [Full GC 26842.997: [ParNew: 8780K->0K(16320K), 0.1036868 secs]26843.101: [CMS26847.868: [CMS-concurrent-mark: 6.326/7.073 secs]
: 853590K->836355K(1531904K), 17.1638384 secs] 859688K->836355K(1548224K), [CMS Perm : 27002K->26991K(65536K)], 17.2680758 secs]
26860.687: [GC 26860.687: [ParNew: 16256K->0K(16320K), 0.0623444 secs] 852611K->837876K(1548224K), 0.0626582 secs]
26860.801: [GC [1 CMS-initial-mark: 837876K(1531904K)] 838817K(1548224K), 0.0118348 secs]
26860.813: [CMS-concurrent-mark-start]
26861.441: [GC 26861.441: [ParNew: 16256K->0K(16320K), 0.0846854 secs] 854132K->840587K(1548224K), 0.0850140 secs]
26861.886: [Full GC 26861.886: [ParNew: 7164K->0K(16320K), 0.1712230 secs]26862.057: [CMS26867.343: [CMS-concurrent-mark: 6.008/6.530 secs]
: 842354K->837940K(1531904K), 17.4745086 secs] 847752K->837940K(1548224K), [CMS Perm : 26997K->26990K(65536K)], 17.6462914 secs]


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a JPEGImage Writer
Create an ImageOutputStream
Call setOutput on the writer passing the stream.

ACTUAL -
Full GC very single call.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
File f = new File("c:\images\myimage.png");
ImageOutputStream ios = ImageIO.createImageOutputStream(f);
writer.setOutput(ios);

As given in your  API guide at
http://java.sun.com/j2se/1.5.0/docs/guide/imageio/spec/apps.fm4.html

---------- END SOURCE ----------
(Incident Review ID: 240632) 
======================================================================

Comments
EVALUATION This was fixed in Tiger as part of 4867874. Closing as a dup of that bug. ###@###.### 2004-03-17
17-03-2004