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

VM should restore filedescriptor limit on ProcessBuilder.start()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 5.0u7, 6
    • hotspot
    • None
    • sparc
    • solaris, solaris_10

      We've had a complaint against SunStudio, 6624797, where it was discovered that
      when an application is run under the IDE it's current/soft file descriptor
      limit (usually 256) is equal to the max/hard limit (usually 65K).
      This caused the application running under the IDE some grief.

      A truss of the VM shows that it ups the current limit here:

      =>[1] _setrlimit()
        [2] os::init_2()
        [3] Threads::create_vm(JavaVMInitArgs*,int*)
        [4] JNI_CreateJavaVM()
        [5] main()

      IMO the VM should remember the original soft limit and restore it between when
      it forks and execs.
      ---------------------------------------------------------
      Incidentally to this I noticed that after a fork the VM will call
      fcntl(FD_CLOEXEC) 65K times. Surely this is not an insubstantial time.
      Cannot the VM runtime issue the fcntl(FD_CLOEXEC) right after each open/
      accept etc?

            xlu Xiaobin Lu (Inactive)
            isoleima Ivan Soleimanipour (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: