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

JPEGImageWriter.setOutput() causes full GC

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.2
    • client-libs



      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)
      ======================================================================

            Unassigned Unassigned
            jleesunw Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: