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

Java.util.zip doesn't allow more than 2036 zip files to be concurrently open on Windows

XMLWordPrintable

    • b91
    • x86
    • windows_2000

        In JDK 1.5.0_06, it is currently not possible
        on Windows (x86 & X64) to have more than 2.048 different zip files
        concurrently open. The problem doesn't occur on Solaris & Linux

             However this is not a windows limitation as a Win32 program which does the same operation using CreateFile doesn't have this problem. Instead this is a limitation built into the C library file handling.

        Please find enclosed a sample program (filehandleshortage.java).

        you will receive an output similar to the following. The program created and then tries to open 2.100 zip files and read from them (see also the comment in the source file).
        Test failed, exception occured. Opened 2036 files

        java.util.zip.ZipException: Too many open files
                at java.util.zip.ZipFile.open(Native Method)
                at java.util.zip.ZipFile.<init>(Unknown Source)
                at java.util.zip.ZipFile.<init>(Unknown Source)
                at FileHandleShortage.doTest(FileHandleShortage.java:52)
                at FileHandleShortage.main(FileHandleShortage.java:27)

        The Fix for the bug 4189011 seems to resolve this same problem for java.io.File. Similar Fix needs to be done for java.util.zip.ZipFile

              bristor Dave Bristor (Inactive)
              vabhat Vasanth Bhat
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: