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

Number of opened files used in select() is limited to 1024 [macosx]

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b105
    • CPU:
      generic
    • OS:
      os_x
    • Verification:
      Verified

      Backports

        Description

        The number of opened files used in select() on MacOSX is limited to 1024 (FD_SETSIZE).
        The following sequence can illustrate the problem:
        1. Open 1023 files (use FileInputStream())
        2. Create socket and try to read from it.
        3. Get the following exception:
        Exception in thread "main" java.net.SocketException: Invalid argument
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:150)
        at java.net.SocketInputStream.read(SocketInputStream.java:121)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)
        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)
        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:604)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1322)
        at SelectFdsLimit.main(SelectFdsLimit.java:86)

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  aefimov Aleksej Efimov
                  Reporter:
                  aefimov Aleksej Efimov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: