JDK-6387136 : orbd consumes one cpu when ulimit -n is used
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 5.0u6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2006-02-17
  • Updated: 2010-08-05
  • Resolved: 2006-02-22
Related Reports
Duplicate :  
Description
if one issues ulimit -n on a system without open file limits OR does the equivalent in /etc/system the orbd deadlogs and 
consumes 1 cpu

$ ulimit -n 256  
$ orbd -ORBDebug orbd -ORBInitialPort 2010 -ORBInitialHost sunccsparc
ORBD begins initialization.
ORBD is ready.
ORBD serverid: 1000
activation dbdir: /home/ms104109/./orb.db
activation port: 1049
activation Server Polling Time: 1000 milli-seconds
activation Server Startup Delay: 1000 milli-seconds

the orbd consumes one CPU in the ioctl:

789/15:         ioctl(11, DP_POLL, 0xB3D7F9AC)                  Err#22 EINVAL
789/15:         ioctl(11, DP_POLL, 0xB3D7F9AC)                  Err#22 EINVAL
789/15:         ioctl(11, DP_POLL, 0xB3D7F9AC)                  Err#22 EINVAL
789/15:         ioctl(11, DP_POLL, 0xB3D7F9AC)                  Err#22 EINVAL

in our case it's 25%, since it's a 4 CPU V440:

$ ps -efl|egrep 'orbd|PID'
 F S      UID   PID  PPID   C PRI NI     ADDR     SZ    WCHAN    STIME TTY         TIME CMD
 0 O ms104109   789   671  25  99 20        ?  44561          08:28:56 pts/1       8:59 orbd -ORBDebug orbd -ORBInitialPort

java is:

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed mode)

System is:

                         Solaris 10 3/05 s10_74L2a SPARC
           Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 22 January 2005

please have a look at the attached pstack output.

you can reproduce this case on any Solaris/SPARC box.

Comments
EVALUATION This is being closed as a duplicate of 6322825 This bug only affects Solaris 10 and only for JDK Versions 5.0u6 onwards, and only if the open file limit is set below 8193. In update 6 the default selector implementation was changed (bug 6286011). The workaround requests the previous implementation.
22-02-2006

WORK AROUND Pass the following VM property to ordb: -J-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.PollSelectorProvider This uses an alternative mechanism that avoids the bug.
22-02-2006

EVALUATION This appears to be the same issue as 6322825. Basically a large array is used to hold the possible set of file descriptors to be polled, but if the size of that array exceeds the maximum number of file descriptors permitted by "ulimit -n" then ioctl will report EINVAL. This bug has been fixed in Mustang (JDK 6). The workaround listed will avoid the bug but as it changes the mechanism used to do the polling/select it may not be suitable for the benchmark in question.
22-02-2006