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

TEST_BUG: HelperSlowToDie.java fails because it exceeds max number of open files

XMLWordPrintable

    • generic
    • generic

      Test
      java/nio/channels/Selector/HelperSlowToDie.java

      fails on Linux (Ubuntu 9.10) with exception. The problem is that on most Linuxes, max number of open files is 1024. The test creates exactly 1024, however some other processes (or VM itself) may be using some already.

      Either the number of channels created could be decreased or test can be changed to autodetect max number of channels (i.e. create them until it's 1024 or exception occurs).

      java.net.SocketException: Too many open files
              at sun.nio.ch.Net.socket0(Native Method)
              at sun.nio.ch.Net.socket(Net.java:300)
              at sun.nio.ch.Net.socket(Net.java:294)
              at sun.nio.ch.SocketChannelImpl.<init>(SocketChannelImpl.java:101)
              at sun.nio.ch.SelectorProviderImpl.openSocketChannel(SelectorProviderImpl.java:60)
              at java.nio.channels.SocketChannel.open(SocketChannel.java:142)
              at HelperSlowToDie.main(HelperSlowToDie.java:44)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:613)
              at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
              at java.lang.Thread.run(Thread.java:717)

            alanb Alan Bateman
            nhaustov Nicolay Haustov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: