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

[macosx] ImageIO.read Multiple threads cause no garbage collection

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.7.0_21"
      Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
      Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      mac os x 10.8.5

      A DESCRIPTION OF THE PROBLEM :
      I use ImageIO.read in Multiple threads
      look at my test case,I use 100 thread,ervery thread process 100 urls
      after about 10 min ,the process is "dead" but not crash
      I use "jstat -gcutil" look at the garbage collection stat
      And found that no garbage collection occurred
        S0 S1 E O P YGC YGCT FGC FGCT GCT
       9.46 0.00 89.56 80.74 39.14 314 1.102 21 0.558 1.659
        9.46 0.00 89.56 80.74 39.14 314 1.102 21 0.558 1.659
        9.46 0.00 89.56 80.74 39.14 314 1.102 21 0.558 1.659
        9.46 0.00 89.56 80.74 39.14 314 1.102 21 0.558 1.659
        9.46 0.00 89.56 80.74 39.14 314 1.102 21 0.558 1.659
        9.46 0.00 89.56 80.74 39.14 314 1.102 21 0.558 1.659
        9.46 0.00 89.56 80.74 39.14 314 1.102 21 0.558 1.659
        9.46 0.00 89.56 80.74 39.14 314 1.102 21 0.558 1.659
      So what's the problem?How can I slove it?


      REGRESSION. Last worked in version 7u21


      REPRODUCIBILITY :
      This bug can be reproduced occasionally.

      ---------- BEGIN SOURCE ----------
      private List<String> urls = new ArrayList<String>();
      public void setUrls(List<String> urls) {
      this.urls = urls;
      }
      @Override
      public void run() {
      for (String url : urls) {
      try {
       InputStream is = new URL(url).openStream();
       BufferedImage img = ImageIO.read(is);
       is.close();
      } catch (Exception e) {
      e.printStackTrace();
      }
      }
      }
      ---------- END SOURCE ----------

            bae Andrew Brygin
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: