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

(process) Should use closefrom(3C) (sol, lnx)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.0
    • core-libs
    • None
    • sparc
    • solaris_9

      In a recent truss of a JVM execution, I noted that of the approximately 1M system calls made, ~700K of them were close() calls failing with EBADF. What appeared to be happening is that Java was trying to close all file descriptors before doing an exec. In Solaris 9 the maximum number of file descriptors was raised to 64K, and so doing this in a simple loop became unreasonable. To handle this situation, the kernel group introduced closefrom(3C), which efficiently closes many file descriptors.

      I don't know what the cost of ~64K failing close() calls is, compared to the cost of an exec(), but it seems likely to be significant.

            mr Mark Reinhold
            jordan Jordan Brown
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: