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

SeedGenerator gets exponentially slower as your temp directory gets larger

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6u16
    • security-libs

      FULL PRODUCT VERSION :
      java version "1.6.0_16"
      Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
      Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows Vista 32-bit Business Edition Service Pack 2

      A DESCRIPTION OF THE PROBLEM :
      This problem is very simple. SeedGenerator has the following lines:

      File file = new File(properties.getProperty("java.io.tmpdir"));
      String as[] = file.list();

      I had a temp directory which was over 8GB in size, and with over 800.000 files. This caused dramatic slowdown and performance problems while starting up various java applications that triggered the generation of random seeds.

      I felt like reporting this as a bug, as it took me some time to figure out. Why does a random generator depend on a temp directory? Wouldn't it be possible to make one that has constant speed over time?

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1)Place a lot of files in your temp directory. (For windows vista this is c:\users\*YOURNAME*\AppData\Local\Temp)

      2)Execute the following:

      File file = new File(properties.getProperty("java.io.tmpdir"));
      String as[] = file.list();

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Seedgenerator should have constant speed regardless of your file system, or any temporary directory that fills up over time.
      ACTUAL -
      The 2 lines extracted from Seedgenerator get progressively slower as the amount of files in your temporary directory increases, to the extent that java can hang up for several minutes.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      File file = new File(properties.getProperty("java.io.tmpdir"));
      String as[] = file.list();
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Clear your temporary directory regularly.

            weijun Weijun Wang
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: