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.