JDK-4791640 : (process) Should use closefrom(3C) (sol, lnx)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2002-12-10
  • Updated: 2002-12-10
  • Resolved: 2002-12-10
Related Reports
Duplicate :  
Description
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.

Comments
EVALUATION This problem was, in fact, fixed in 1.4.0_03 and subsequent releases (4413680). -- ###@###.### 2002/12/10
12-10-0176